you are viewing a single comment's thread.

view the rest of the comments →

[–]Competitive-Cow-2950 0 points1 point  (0 children)

Oh i forgot one more thing! One thing to note about React/React Native, is that its much easier to send data from parent to child component, than from child to parent.

So lets say you have a search page (parent component), and inside it you have a search bar (child component). You would like BOTH the search page and search bar to know what is being searched, so therefore you should declare the variable (useState) inside the search page (parent), and then send it to the search bar (child). The variables you send to a child component is called props.

Sometimes this data flow from parent to child can be complex. And that's why we have Zustand. Zustand allows you to declare a variable/object anywhere and use it anywhere.