React useState Hook

import React, { useState } from React
function LikeButton(){
const [likes, setLikes] = useState(0);
}
function LikeButton(){
const [likes, setLikes] = useState(0);
return(
<div>
<h3>Likes:{likes}</h3>
<button onClick={() => setLikes(likes + 1)}>
Like Me!
</button>
</div>
)
}

--

--

--

Full-stack web developer with a background in the service industry, sound design, audio engineering, and theatre performance.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Announcing NestJS 6: What’s New? 🍷

How to use Filter, Map, and Reduce in JavaScript!

How to Test TypeScript 4.0-beta Features

Basic JavaScript you need to know.

CQRS Facades: Cleaner Code Separation

Component Design Patterns

Connection Pools what,where and why ?

Javascript Subsequence

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Kamrin Kennedy

Kamrin Kennedy

Full-stack web developer with a background in the service industry, sound design, audio engineering, and theatre performance.

More from Medium

REACT COMPONENT AND PROPS

React Storybook

React js

Introduction To React Js