[Redux] React Redux

채동기·2022년 11월 28일
0

Redux

목록 보기
1/4

시작하기
Using Create React App
with vanilla JS​

Redux + Plain JS template

npx create-react-app my-app - template redux
with TypeScript

Redux + TypeScript template

npx create-react-app my-app - template redux-typescript
An Existing React App
이미 존재하는 프로젝트에서 사용할 경우

If you use npm:

npm install react-redux

Or if you use Yarn:

yarn add react-redux
밑의 예시처럼 를 사용하여야 합니다.
Redux를 사용할 수 있습니다.

import React from 'react'
import ReactDOM from 'react-dom/client'
import { Provider } from 'react-redux'
import store from './store'
import App from './App'

// As of React 18

const root = ReactDOM.createRoot(document.getElementById('root'))
root.render(
 <Provider store={store}>
 <App />
 </Provider>
)
profile
what doesn't kill you makes you stronger

0개의 댓글