Using ES6 Map with React State hooks
Nov 4 · 2 min read
State hooks are a great addition to react that allows us to write stateful components concisely without the use of a class component. If you are familiar with React, you know that to use state, you’d have to write a class component —
class Example extends React.Component {
constructor(props) {
super(props);
this.state = {
count: 0
};
}
render() {
return (
<div>
<p>You clicked {this.state.count} times</p>
<button onClick={() => this.setState({ count: this.state.count + 1 })}>
Click me
</button>…

