Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- app.model = {
- addItem: function() { .. }
- update: function() { .. }
- }
- <MyButton model={app.model}>Add Item</MyButton>
- var MyButton = React.createClass({
- render: function() {
- return (
- <div className="coolButton" onClick={this.props.model.addItem}>
- {this.props.children}
- </div>
- })
- var MyModal = React.createClass({
- getInitialState: function() {
- return {isShown: false};
- },
- render: function() {
- if (this.state.isShow===false) {
- return
- }
- return (
- <div className="modal">
- {this.props.children}
- </div>
- })
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement