• 🚀 React Introduction
  • 🔏 React Structure
  • 🔏 React Components
  • 🔏 React props
  • 🔏 React Styling & UI
  • 🚀 React Router
  • 🔏 React Events
  • 🚀 React useState
  • 🔏 React useEffect
  • 🔏 React API Integration
  • 🔏 React useContext
  • 🔏 React useRef
  • 🔏 React Storage
  • 🔏 React useMemo
  • 🔏 React useReducer
  • 🔓 React Redux
  • 🔏 React Authentication
  • 🔏 React Testing
  • 🔏 React Build & Deploy

React With useState Hook


Allows you to add state to your functional components. The useState Hook returns an array with two elements: the current state value and a function to update the state.


How To Define State

import { useState } from 'react'

const [ data , setData ] = useState ( init )