survivejs / react-book

From apprentice to master (CC BY-NC-ND)
https://survivejs.com/react/introduction/
2.02k stars 366 forks source link

Fix warning: Unknown prop `onEdit` on <input> tag #423

Closed hugochougt closed 8 years ago

bebraw commented 8 years ago

The {...props} pattern is there for a reason, but we could refactor it out. Another way to solve the warning would be to extract it from props before it gets to input. I have to give this some careful thought.

Thanks for pointing this out.

hugochougt commented 8 years ago

@bebraw OK. I am going to close this PR.

bebraw commented 8 years ago

No worries. I'll try to get this fixed in the next few days. 👍

jcmoraisjr commented 8 years ago

@bebraw regarding the warning, just to let you know I changed the first line of render() from:

const {value, ...props} = this.props;

to:

const {value, onEdit, ...props} = this.props;

This way onEdit was removed from ...props and everything worked like a charm.