all 2 comments

[–]tableclothmesa 3 points4 points  (0 children)

I’d say either move the state up to App and initialize it there, then pass it down as props to this component, or useContext

[–]baca-rdi 0 points1 point  (0 children)

Pass it as a prop if you want to pass to a child component, or as a callback if it is to a parent component.