Closed camjackson closed 7 years ago
Actually the whole page is kinda opinable... People shouldn't pass "random" props to the child components and hope that the child component doesn't apply them to the underlying HTML tags.
The right approach is to make all the properties get redirected/applied to the underlying HTML tags and apply to the component only the properties that are supposed to be there.
Just my 2 cents obviously
I agree with @FezVrasta that passing random props using spread operator might not be the cleanest way to handle them (especially when it is applied to DOM elements). However, it helps at times when applying to Components and might give an idea for users on its usage. Thanks :)
@vasanthk I was speaking in favor of this PR and against the rest of the existing page 🙃
This is the approach mentioned in the official docs here: https://reactjs.org/warnings/unknown-prop.html. Which is not to say that it's better than what's currently in this repo, but it can't help to list a couple of ways to solve the problem :)