react-mdl
react-mdl copied to clipboard
Support for immutable-js objects
(Most?) react-mdl components, e.g. DataTable, only support js native arrays and objects as props. React itself also allows for direct use of immutable-js (and similar) datatypes since 0.13:
Support for iterators and immutable-js sequences as children.
Changing this behavior currently is as easy as replacing PropTypes.arrayOf(...) or similar with PropTypes.any.
I am currently planning on solving this using a function custom type checker testing the objects constructor name. Any input on this?
PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.object),
function(props, propName, componentName) { [...] },
])
Great! How would you check if it's an iterator or immutable-js object?