Closed ashercoren closed 5 years ago
Consider the following propTypes decoration:
MyComponent.propTypes = { element: PropTypes.func, }
Providing a simple React function (element={(props) => ...}) works fine, but if I wrap the function with React.memo, I get the following warning:
element={(props) => ...}
Failed prop type: Invalid prop `element` of type `object` supplied to `MyComponent`, expected `function`.
It’s not a function.
If you’re trying to make a propType for “thing you can make an element from”, you may want elementType?
thanks.
Consider the following propTypes decoration:
Providing a simple React function (
element={(props) => ...}
) works fine, but if I wrap the function with React.memo, I get the following warning: