Created
July 3, 2018 23:29
-
-
Save alastairparagas/2a639cdcea276b9614958a1d1ae16d0a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Your React Component | |
| class VisaCheckboxComponent extends React.Component { | |
| // Deal with your constructor as you please | |
| // Other methods of your component | |
| onClick() { | |
| this.props.onClick(); | |
| // Other stuff that onClick should do like setState | |
| } | |
| // This render returns the actual HTML code of Visa Web UI, in JSX form | |
| render() { | |
| return ( | |
| <whatever-visa-html-code... onClick={this.onClick.bind(this)}> | |
| ); | |
| } | |
| } | |
| // When using your component - goToAnotherPage | |
| <VisaCheckboxComponent onClick={() => { | |
| // Do stuff here that handles the actual routing to another page | |
| }}> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment