- Complicated Process
- Small vendors had problem with it
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
import React, { useState } from "react"; | |
const CounterFuncBased = () => { | |
const [count, setCount] = useState(0); | |
const updateCounter = () => { | |
setCount(count + 1); | |
}; | |
return ( | |
<div> | |
<p>You have clicked the button : {count} times!</p> |
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
import React, { Component } from "react"; | |
class CounterClassBased extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0, | |
}; | |
this.updateCounter = this.updateCounter.bind(this); | |
} |