Hi, I have a question about organizing React component and specifically state. When should a component have state?
Say I have a Movie website that has 4 components:
- APP component with state (an array holding list of movies)
- SEARCH component which updates state in the APP component
- MOVIES component which holds individual MOVIE components
- MOVIE components which render individual movies
Currently only the APP component has state and passes it down to MOVIES as props which passes it down to individual MOVIE components as props.
So obviously it works but it gets a little confusing as methods on APP are being called for everything as that is where the state is. Should MOVIES have its own state holding the movie data? Should each MOVIE components have its own state? When should a component have state?