survivejs / react-book

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

[Section 3.4 - Pushing Data to App] Need some basic 'props' information #435

Closed JESii closed 2 years ago

JESii commented 7 years ago

"...pass the data through a prop to Notes." I believe this is the first time you've referred to 'props' in the context of React. It would be helpful to include some context here to let folks know what this is. I've had a bit of experience with props from previous work but always found it a bit confusing.

I went to the React doc page (https://facebook.github.io/react-native/docs/props.html) and found the first paragraph to be very helpful: "Most components can be customized when they are created, with different parameters. These creation parameters are called props." And the simple example was great. Now clarified in my mind.

bebraw commented 7 years ago

Yeah, one of the early chapter has to go through the concepts in great detail. Props are simply those parameters you pass to a component (const Component = ({... props go here ...})).