dyo / dyo

Dyo is a JavaScript library for building user interfaces.

Home Page:https://dyo.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

'ref' and 'key' should not be included in props

rosenfeld opened this issue · comments

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 :)

I've just updated the title to include the key prop as well, thanks!