Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import React from 'react';
- class generalButton extends React.Component {
- constructor(props : any) {
- super(props);
- this.state = { };
- // This binding is necessary to make `this` work in the callback
- this.handleClick = this.handleClick.bind(this);
- }
- // Need to create usable functions to bind
- handleClick() {
- this.setState(state => ({/* bind to action*/ }));
- }
- render() {
- return (
- <div>
- <h1> General Button </h1>
- <button
- style={{ height: "56px", width: "30%" }}
- onClick={this.handleClick}>
- </button>
- </div>
- );
- }
- }
- export default generalButton;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement