FEC-corgis / Paul-Service-Entire_house

0 stars 0 forks source link

Naming props #4

Closed manedurphy closed 3 years ago

manedurphy commented 3 years ago

https://github.com/FEC-corgis/Paul-Service-Entire_house/blob/35ffe2c2f5ddf770257eaebb226b91fe2f81c545/client/hosted.jsx#L53

Rather than passing "state" as a prop, try <HostedList detes={this.state.detes[0]}/>... and in your HostedList component, props.detes.property_space_available (or whatever property you need on the detes object).

In general, I am not sure I understanding the strategy of setting the state to an array of one object though. Would it be possible to just set the state to the data you get back from you API call, and then passing that information like so: <HostedList detes={this.state}/>

... or is the array something you intend on iterating over later?

pauly-van commented 3 years ago

Thanks for this, I made a refactor of a ton comments on a new branch: https://github.com/FEC-corgis/Paul-Service-Entire_house/pull/7