Great article. Have a question about React.PropTypes and ImmutableJS on an isomorphic project I am working on.
For example, I have a piece of state/ the redux store called ‘chores’ that is an immutable map with I call into state through a connector. For the PropType validation, I have been using: React.PropTypes.instanceOf(Immutable.Map), which seems to be working fine.
However, when I am in the connected component and do:
const laundry = chores.get(‘laundry’)
However, when I pass down ‘laundry’ into a dumb-component and then use PropTypes for laundry as a PropTypes.object, I am having issues (see error below). It also did not work with instanceOf(Immutable.Map). I don’t understand why this is happening and I would like to keep using proptypes.
`Invariant Violation: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. Check the render method of <Component>`
If you have any insights, they would be greatly appreciated. Also, I am just curious as to why you did not include PropTypes?