react render hooks code example
Example 1: react useeffect
import React, { useEffect } from 'react';
const [data,setData]=useState()
useEffect(() => {
fetch(`put your url/api request in here`)
.then(res=>res.json())
.then(json => setData(json))
},[])
Example 2: react hooks
useEffect(() => {
document.title = `You clicked ${count} times`;
}, [count]); // Only re-run the effect if count changes