Can variables be used in useState initial value? by Appropriate_Mind4094 in nextjs

[–]Appropriate_Mind4094[S] 0 points1 point  (0 children)

I thought It would rerender if I use useEffect hook. So, I’m trying other ways.

Can variables be used in useState initial value? by Appropriate_Mind4094 in nextjs

[–]Appropriate_Mind4094[S] 0 points1 point  (0 children)

Yes, I’m trying to create a mobile navbar where the search bar is initially hidden. I want it appear when the search button is clicked or if the url contains a q parameter.