useEffect Hook in ReactJs

 App.js:


import React from 'react';
import { useState } from 'react';
import { useEffect } from 'react';

import './App.css'

function App()
{
  const [count, setCount]=useState(0)
  useEffect(()=>{console.warn("useEffect")})
 return(
  <div className='App'>
    <h1>useEffect in React {count}</h1>
    <button onClick={()=>setCount(count+1)}>Update Counter</button>
  </div>
 )
}

export default App;



Comments

Popular posts from this blog

Send Data Child to Parent Component - React Js

Hide , Show and Toggle in ReactJs

Importance Of Web Content In SEO.