예시: Todo List
기초 튜토리얼에서 만들었던 할일 앱의 전체 소스코드입니다.
Entry Point
index.js
index.jsimport React from 'react';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import App from './containers/App';
import todoApp from './reducers';
let store = createStore(todoApp);
let rootElement = document.getElementById('root');
React.render(
// React 0.13의 이슈를 회피하기 위해
// 반드시 함수로 감싸줍니다.
<Provider store={store}>
{() => <App />}
</Provider>,
rootElement
);Action Creators and Constants
actions.js
actions.jsReducers
reducers.js
reducers.jsSmart Components
containers/App.js
containers/App.jsDumb Components
components/AddTodo.js
components/AddTodo.jscomponents/Footer.js
components/Footer.jscomponents/Todo.js
components/Todo.jscomponents/TodoList.js
components/TodoList.jsLast updated