when to use react hooks code example
Example 1: reference hook in react
import React, {useRef} from 'react'
const displayNode = useRef(null)
//action
displayNode.current.textContent = `${count} Appointments Successfully Uploaded`
//referenced object
<div ref={displayNode} className="text-center mt-3 msg" style={{ color: "green", fontWeight: "800" }}></div>
Example 2: react hooks
const [state, setState] = useState(initialState);