Seen this a few times as a bit of a common theme in Reactiflux's #need-help channel. New Hooks users (with only minimal prior React experience) are hitting the Hooks docs, and having some success using basic hooks (e.g., useState), but are missing how "hook components" consume props.
I think there's a bit of an issue of "hook components" not necessarily being recognized as "function components", or users not being familiar with function components to start with.
Looking at the first two pages of hooks docs, we get to the fourth example component before any props are used. I'm (unfortunately) guessing that users aren't reading solidly to that point to see the example.
Proposed solution
Could the intro page's example include using props? Or perhaps a second intro page example which does. I think it needs to be pretty early in the new user's reading flow, before they attempt to write their own component, and before they jump to reading the later pages.
Long term solution
At the moment, I think a large contributing factor is that the Hooks documentation is still mostly standalone from the rest of the docs. I think the combination of newness wearing off, and integration into the "main" docs will eventually solve this problem.
Seen this a few times as a bit of a common theme in Reactiflux's #need-help channel. New Hooks users (with only minimal prior React experience) are hitting the Hooks docs, and having some success using basic hooks (e.g., useState), but are missing how "hook components" consume props.
I think there's a bit of an issue of "hook components" not necessarily being recognized as "function components", or users not being familiar with function components to start with.
Looking at the first two pages of hooks docs, we get to the fourth example component before any props are used. I'm (unfortunately) guessing that users aren't reading solidly to that point to see the example.
Proposed solution
Could the intro page's example include using props? Or perhaps a second intro page example which does. I think it needs to be pretty early in the new user's reading flow, before they attempt to write their own component, and before they jump to reading the later pages.
Long term solution
At the moment, I think a large contributing factor is that the Hooks documentation is still mostly standalone from the rest of the docs. I think the combination of newness wearing off, and integration into the "main" docs will eventually solve this problem.