Open dashed opened 9 years ago
Any validation violations would be warnings in the console.
@Dashed Would this fit your use case? https://github.com/HurricaneJames/react-immutable-proptypes
@unindented Cool! I'll definitely check this out.
@Dashed Yeah, the question is. Do we think this is something that Immstruct should do, or is this a React thing?
@mikaelbr I feel this would help debugging a lot.
I didn't really elaborate on my first post; but I wanted to suggest to 'copy' proptype checking that React does and perform the type check against a Structure instance instead of this.props
. That way user can use userland proptypes (e.g. HurricaneJames/react-immutable-proptypes
) meant for React, and as well as React's proptypes.
Something like this for immstruct structures https://github.com/tgriesser/state-types-react https://facebook.github.io/react/docs/reusable-components.html#prop-validation
API sketch: