'ref' and 'key' should not be included in props
rosenfeld opened this issue · comments
Rodrigo Rosenfeld Rosas commented
You can see the different behavior between React and Dio.js here:
https://codesandbox.io/s/r1r6o8l324
This is specially a problem when the component renders like:
const MyComponent = function(props) {
return <AnotherComponent ref={ this.setRef } {...props} />;
}
This way ref would be overridden when creating MyComponent ref={...}
.
This code works with React because React will strip ref from props and I think Dio.js should do the same to keep it compatible with React libraries.
Thanks :)
mcjazzyfunky commented
Same with "key":
https://codesandbox.io/s/1zvj3ko7r7
Rodrigo Rosenfeld Rosas commented
I've just updated the title to include the key prop as well, thanks!