> For the complete documentation index, see [llms.txt](https://gpeterhand.gitbook.io/react/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://gpeterhand.gitbook.io/react/redux/podklyuchaem-redux.md).

# Создаем Store

Устанавливаем Redux

> yarn add redux react-redux

Изменяем файл **src/App/index.js**

```jsx
...
import { createStore } from 'redux'
import { Provider } from 'react-redux'
...
import rootReducer from './services'
...

const App = () => (
  <Provider store={createStore(rootReducer)}>
    <BrowserRouter>
      ...
    </BrowserRouter>
  </Provider>
)
...
```

Создаем корневой редьюсер:

{% code title="scr/App/services.js" %}

```jsx
const rootReducer = (state = {}, action) => {
  console.log(action)
  return state
}

export default rootReducer
```

{% endcode %}

Запускаем. В консоли должно отобразится: *{type: "@@redux/INIT..."}*

Это значит, что store инициализировался, а также сработал начальный экшен Redux

**Примечание:**  HMR по умолчанию не работает при изменении редьюсеров. Для этого нужно [сделать дополнительные действия](https://github.com/reduxjs/react-redux/releases/tag/v2.0.0) или [так](https://github.com/supasate/connected-react-router/blob/master/FAQ.md#how-to-hot-reload-reducers). Но, у меня пока почему-то не заработало. Оставим на потом...
