Learning About UseState Hooks

import React, { useState } from 'react'
const TeamLike = () =>  {const [likes, setlikes] = useState('')...
const [likes, setlikes] = useState('')// synonymous to 'this.state.likes' & 'this.state.setState'
const incrementLike = (event) => {
let newlikes = likes + 1
return setlikes(newlikes)
}
return(
<div>
<p><strong>{likes}</strong> people have said you are amazing! </p>
</div>
)
<p>{selectLikes}</p>==> 1

--

--

--

Fullstack Software Engineer | Musician | Food Lover | Coffee Addict

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

Recommended from Medium

Rinne Sharingan Contacts

Page keep reloading

Learning JavaScript by Implementing Lodash Methods — Grouping Items

Getting Started with React Bootstrap

Build your own Web CV with Aurelia

Vuetify — Menus

Tips To Effectively Master JavaScript

Mobile Development with Ionic and Vue — Grid and Inputs

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
Grace Yuiko Nakano

Grace Yuiko Nakano

Fullstack Software Engineer | Musician | Food Lover | Coffee Addict

More from Medium

DineOut-Clone with ReactJS

An Overview of Array Methods

How to Iterate through an object keys and values in JavaScript.

CellEnMon-Research Part 8 — Technical problem formulation