How to correctly display the response from the react server in state?
Hello everyone, I study react, such a question - I make a request to the server, get users and organizations for further output through the components, I organized the code in this way. I wanted to know how much is correct? In the future, there will be a filter of users by the organization to which it belongs, it turns out the state will change and I think how to organize everything correctly, probably the array with users should be inside the state.
Yes. Everything that affects the rendering of a component and changes its value during the life cycle must be inside the stateAnonymous
To place the code, please use CodePen or similar tool. Thanks you!