A component that uses state has two snippets of code as given here
A<h1>It is {this.state.date.toLocaleTimeString()}.</h1>
B.<MyStuff thing={this.state.thing}/>
Which of the snippets may lead to issues in the architecture?
Options
- Both A and B are fine. The children receive the state as props
- Yes, this is fine for A but not for B since user defined components would have their own state
- Yes, this is fine for B, but not for A, since the state can be modified in the child with unpredictable consequences
- No, this is not fine for either A or B since the state may be cascaded and would lead to unpredictable re-rendering