react-spawn-x
spawn-x.
React connector forinstall
With npm:
npm install spawn-x react-spawn-x --save
With yarn:
yarn add spawn-x react-spawn-x
Usage
app/index.js
;;; ReactDOM;
app/store/index.js
; const initialState = users: some: text: 'Hello World' parent: child: 'I am child' const store = ; { return { ; console; }}
app/actions/user.js
; const addUser = { store;};
app/containers/App.js
;; ;;; { return <div className="App"> <MyPresenterComponent users=thispropsusers text=thispropstext data=thispropsdata addUser=addUser/> </div> ; } //our selection from state (for data we apply specific selector. It's just for example)const selection = users: 'users' text: 'some.text' data: 'parent.child' stateparentchild; //wrap App componentstoreselectionApp;
app/components/Presenter.js
; { ev; console; console; thisprops; evtargetnamevalue = ''; evtargetagevalue = ''; } { return <div> <h1>User List</h1> <ul> thispropsusers </ul> <form onSubmit=thishandleSubmit> <input type="text" name="name"/> <input type="number" name="age"/> <button type="submit">Add New User</button> </form> </div> } ;
LICENSE
MIT © Alex Plex