Hook: useState, useEffect

Jiyun Park
Dec 5, 2020

hook series / React v16.8^

“With Hooks, you can extract stateful logic from a component so it can be tested independently and reused.”

  • useState
  • useEffect

useState returns a pair: the current state value and a function that lets you update it. You can think of useEffect Hook as componentDidMount, componentDidUpdate, and componentWillUnmount combined.

source: React Document

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

No responses yet

Write a response