Reactjs – Custom react hook – useState not working on initialization
I am new to react and react hooks. I am creating a custom react hook. Why is useState not working as expected. import { useEffect, useState } from 'react' export const useMyHook = () => { const [myVal, setVal] =…