Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Client extends React.Component {
- constructor (props) {
- super(props);
- }
- add(e){
- this.context.dispatch('ADD_ITEM', {name:'Marvin'});
- }
- render() {
- return (
- <div>
- <h2>Client</h2>
- <p>List of all the clients</p>
- <button onClick={this.add}>Click Me</button>
- <ul>
- </ul>
- </div>
- );
- }
- }
- Client.contextTypes = {
- dispatch: React.PropTypes.func.isRequired
- };
- export default Client;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement