In react, is it better to pass props to child components or using useSelector in child component?

Viewed 34

For example I have 3 components, here is the nest relationship

<a>
  <b>
    <c>
    </c>
  </b>
</a>

should I create useSelector in compontn a? and pass props to c. or should I just useSelector in c? what will be the main difference?

1 Answers

Unless you need the the some data from the useSelector() in Component a, you can choose to remove it from Component a and create it in the Component c. Or you can have them in both Component a and Component c

Related