Open emipc opened 6 years ago
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 onChange is marked as required in SlateEditor, but its value is undefined.
onChange
SlateEditor
undefined
I've added a console.log to ensure onChange exists and it does.
console.log
Do you know why it's throwing me this warning?
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:
And I've added the missing props like these ones:
Nevertheless, I'm getting this warning:
I've added a
console.log
to ensureonChange
exists and it does.Do you know why it's throwing me this warning?