# Main idea

@react-state holds application state as single immutable object.&#x20;

Your application is made from different routes. Each route has multiple nested components. So idealy your initial state should&#x20;

* representation of your root routes\*
* nestetd states should be representation of your smart components on that page

Path to the state is built by passing path to child components.&#x20;

State actions are injected into component which can access certain peace of state.

![](https://1022882979-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauZLLqXJJcAhFbBISq%2F-LauZq314wYgBuVXdihW%2F-Laub-GQUb61lQPuZVCA%2Fassets_-La0zIK2BFiXY6Eig7aR_-LaLArlDKE5QccKGswbV_-LaLAvbb7bYKLFgQMThL_state%20flow.svg?alt=media\&token=3822be15-7fa9-4299-9213-b32259dbe0a1)

&#x20;*\* there can be exceptions for objects that really needs to be shared accross all application for example userData*
