Closed tarhunakau closed 8 years ago
My colleague was ahead of me... :) I have the same problem with CustomComponent. I spend the day trying to solve this problem but the warning remains.
Warning: Failed propType: Invalid prop CustomComponent supplied to Notif, expected a ReactNode. Check the render method of Notifs.
Moreover, I have the same warning on your demo!!
@BLRplex @f3arnil I'll investigate this. Theres a slight chance we introduced a bug with the amount of changes we made to the latest release.
What are you passing as CustomComponent
- It is a react object/component, correct?
Yes, correct. My code is next:
class Message extends Component {
...
render() { return ... }
}
<Notifs CustomComponent={ Message } ... />
When I launched your demo the warning message appears too.
PropType should be React.PropTypes.func because you pass just a function. https://facebook.github.io/react/docs/reusable-components.html#stateless-functions
I'm not sure about React.PropTypes.node and React.PropTypes.element, but we can use React.PropTypes.oneOfType([React.PropTypes.func, React.PropTypes.node, React.PropTypes.element])
Sorry, just experimenting with my repo
Warning: Failed propType: Invalid prop
CustomComponent
supplied toNotif
, expected a ReactNode. Check the render method ofNotifs
.This message appears when Custom Component renders. Also it appears in Demo of this component.
React: 15.0.2 Redux: 3.5.2 React-Redux: 4.4.5