Skip to content

Commit f2c4519

Browse files
author
xhlulu
committed
Fix prop types to stop warnings
Many warnings are caused by incorrect proptypes introduced in #117
1 parent 6affa2f commit f2c4519

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/lib/components/Cytoscape.react.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ Cytoscape.propTypes = {
747747
*/
748748
tapNode: PropTypes.exact({
749749
/** node specific item */
750-
edgesData: PropTypes.object,
750+
edgesData: PropTypes.array,
751751
/** node specific item */
752752
renderedPosition: PropTypes.object,
753753
/** node specific item */
@@ -771,15 +771,15 @@ Cytoscape.propTypes = {
771771
/** General item (for all elements) */
772772
style: PropTypes.object,
773773
/** Item for compound nodes */
774-
ancestorsData: PropTypes.object,
774+
ancestorsData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
775775
/** Item for compound nodes */
776-
childrenData: PropTypes.object,
776+
childrenData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
777777
/** Item for compound nodes */
778-
descendantsData: PropTypes.object,
778+
descendantsData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
779779
/** Item for compound nodes */
780-
parentData: PropTypes.object,
780+
parentData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
781781
/** Item for compound nodes */
782-
siblingsData: PropTypes.object,
782+
siblingsData: PropTypes.oneOfType([PropTypes.object, PropTypes.array]),
783783
/** Item for compound nodes */
784784
isParent: PropTypes.bool,
785785
/** Item for compound nodes */
@@ -872,9 +872,9 @@ Cytoscape.propTypes = {
872872
* the image, it may be prudent to invoke `'download'` for `action` instead of
873873
* `'store'` to improve performance by preventing transfer of data to the server.
874874
*/
875-
generateImage: PropTypes.exact({
875+
generateImage: PropTypes.shape({
876876
/** File type to output */
877-
type: PropTypes.oneOf(['svg', 'png', 'jpg', 'jpeg']).isRequired,
877+
type: PropTypes.oneOf(['svg', 'png', 'jpg', 'jpeg']),
878878
/** Dictionary of options to cy.png() / cy.jpg() or cy.svg() for image generation.
879879
* See https://js.cytoscape.org/#core/export for details. For `'output'`, only 'base64'
880880
* and 'base64uri' are supported. Default: `{'output': 'base64uri'}`.*/

0 commit comments

Comments
 (0)