Before you use the React Redux bindings, learn what to create a all simple application with just React and Redux.
<HTML><Head> <MetaCharSet= "Utf-8"> <title>JS Bin</title> <Scriptsrc= "Https://cdnjs.cloudflare.com/ajax/libs/redux/3.0.4/redux.js"></Script> <Scriptsrc= "Https://fb.me/react-0.14.0.js"></Script> <Scriptsrc= "Https://fb.me/react-dom-0.14.0.js"></Script></Head><Body> <DivID= ' root '></Div></Body></HTML>
Const COUNTER = (state = 0, action) = = { Switch(action.type) { Case' INCREMENT ': returnState + 1; Case' Decrement ': returnState-1; default: returnState ; }} const Counter=({value, onincrement, ondecrement})= ( <div> ); const {CreateStore}=Redux;const Store=createstore (counter); const Render= () + ={Reactdom.render (<Counter Value={store.getstate ()} onincrement={() =Store.dispatch ({type:' INCREMENT '})} ondecrement={() =Store.dispatch ({type:' Decrement ' }) } />, document.getElementById (' root ') );}; Store.subscribe (render); render ();
From React 0.14, you can declear a compoment by using a function.
[Reduc] React Counter Example