Taming the State in React: Your journey to master Redux and MobX by Robin Wieruch

Taming the State in React: Your journey to master Redux and MobX by Robin Wieruch

Author:Robin Wieruch [Wieruch, Robin]
Language: eng
Format: epub
Publisher: leanpub.com
Published: 2018-05-07T22:00:00+00:00


src/index.js import React from 'react'; import ReactDOM from 'react-dom'; import { applyMiddleware, combineReducers, createStore } from 'redux'; import { Provider, connect } from 'react-redux'; import { createLogger } from 'redux-logger'; import { schema, normalize } from 'normalizr'; import uuid from 'uuid/v4'; import './index.css';

You can try to create a todo item in your Todo application now. It should work. Next you want to make use of your filter functionality to filter by completeness status of a todo item. First, you have to add a Filter component.

src/index.js function Filter({ onSetFilter }) { return ( <div> Show <button type="button" onClick={() => onSetFilter('SHOW_ALL')}> All</button> <button type="button" onClick={() => onSetFilter('SHOW_COMPLETED')}> Completed</button> <button type="button" onClick={() => onSetFilter('SHOW_INCOMPLETED')}> Incompleted</button> </div> ); }



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.