Guest User

Untitled

a guest
Mar 19th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.76 KB | None | 0 0
  1. ## Next Issues
  2. * State Management
  3. * Persistence
  4. * Ajax
  5. ## State Management
  6. ### What is state?
  7. * State is data in application that can change. The more state and more spread out our state is, the more complex our system becomes to maintain and debug.
  8. ### How is state different from props
  9. * State's implementation is different from props in the way that when state variable value is changed, React calls rerender but not with props variable value change.
  10. * props variable can be assigned using JSX attribute but state variable can't be assigned like that.
  11. ### Intial State
  12. * *getInitialState* can be set some fixed value or props value.
  13. ### Types
  14. #### Application State :
  15. * The state or data in our application that is core to the functionality of the application as a whole. This usually includes a list of the *models* and *data* being manipulated by the interface. If we were to reload our application, the Application state is what we would like to persist the most
  16. * is maintained as high up in the application as possible.
  17. #### Local Component State:
  18. * This is state that is used to allow a component to function. Local component state is not generally used by other component and it is less likely to persist if application is reloaded.
  19. ### Unidirectional Data Flow
  20. * Application State flows down to local component state. Our application Component doesn't keep instances of instancves of local components in some sort of variables. This means application can't call any method on any child by design. So if it wants to change anything, it will just rerender the whole UI with new application state data wthat is passed to child components.
  21. * Hence the data flows to only one point, the top most application component. So data flows down and if data changes, it will update all the child components
Add Comment
Please, Sign In to add comment