Skip to content

Instantly share code, notes, and snippets.

@Zapix
Created June 18, 2016 06:46
Show Gist options
  • Select an option

  • Save Zapix/bddfa20ba5e4468fd6d786ed01abfbf9 to your computer and use it in GitHub Desktop.

Select an option

Save Zapix/bddfa20ba5e4468fd6d786ed01abfbf9 to your computer and use it in GitHub Desktop.

Revisions

  1. Zapix created this gist Jun 18, 2016.
    18 changes: 18 additions & 0 deletions es7.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    class SomeComponent extends React.Component {
    static propTypes = {
    action: PropTypes.func,
    }

    handleSubmit() {
    const { action } = this.props;
    action();
    }

    render() {
    return (
    <form onSubmit={::this.handleSubmit}>
    <button type="submit">Submit</button>
    </form>
    );
    }
    }