bookmarkd
bookmarkd copied to clipboard
Violations of the minimal state principle.
I recommend trying to construct your react apps in a way that has as little state as is possible. If you can calculate something based on props, or other pieces of state - then that thing should not be additional state.
To give an example of this - in the pageHeader component. You set a search value in state, and then based on this value, and the prop books you generate search results which are then also saved into the state.
I would suggest removing search results from the components state, and extracting the logic into a function like (searchTerm, books) => searchResults which you can call in the render method as and when you need it.