This repository was archived by the owner on Nov 4, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
ESLint and PropTypes #65
Copy link
Copy link
Open
Description
I'm using ESLint in my project and it was throwing me some errors related to props missing in props validation.
e.g. This is what the original source code looks like for StateEditor.js:
SlateEditor.propTypes = {
initialState: PropTypes.object
}
And I've added the missing props like these ones:
SlateEditor.propTypes = {
initialState: PropTypes.object,
onChange: PropTypes.func.isRequired,
plugins: PropTypes.array,
children: PropTypes.node.isRequired,
};
SlateEditor.defaultProps = {
plugins: [],
initialState: undefined
};
Nevertheless, I'm getting this warning:
Warning: Failed prop type: The prop
onChangeis marked as required inSlateEditor, but its value isundefined.
I've added a console.log to ensure onChange exists and it does.
Do you know why it's throwing me this warning?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels