Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // edit or new
- class Edit extends React.Component {
- constructor(props) {
- super(props);
- this.state = {
- model: {
- name: "hoge",
- },
- }
- }
- onSubmit() {
- const model = this.refs.form.getData();
- console.log(JSON.stringify(model));
- }
- render() {
- const { model } = this.state
- return(
- <div>
- <button onClick={this.onSubmit.bind(this)}>
- Save
- </button>
- <Form model={model} ref="form" />
- </div>
- );
- }
- }
Add Comment
Please, Sign In to add comment