fac25 / week5-Alex-Sumithra-ClientReactApp

https://whimsical-tulumba-87c33d.netlify.app/
0 stars 0 forks source link

Creating and reusing a component #26

Open Glombort opened 1 year ago

Glombort commented 1 year ago

Really nice use of components, and Reacts statefulness here was super fun to read through!

Just one lil bit of creating more modular code (you know my fave😎), in <NameInput> there's a really nice opportunity to modularise React components to what they do best and allow repetition. Although the 2 examples below take in slightly different props, there should be quite a neat way of creating and then reusing a component. This allows to send the unique properties of the two elements down but have all the non-unique elements to be set in the component itself😃

https://github.com/fac25/week5-Alex-Sumithra-ClientReactApp/blob/d85dd225bac8c0156433e080389666e7c0b58e8b/src/Components/NameInput.jsx#L19

https://github.com/fac25/week5-Alex-Sumithra-ClientReactApp/blob/d85dd225bac8c0156433e080389666e7c0b58e8b/src/Components/NameInput.jsx#L32