Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Calculator extends React.PureComponent {
- constructor(props) {
- super(props);
- this.state = {
- result: 0
- };
- }
- subtract = (a,b) => {
- return a - b;
- }
- add = (a,b) => {
- return a + b;
- }
- render(){
- return <p>{this.add(5,5)}</p>
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement