N
N
Nikita Shchypylov2018-09-04 11:55:18
React
Nikita Shchypylov, 2018-09-04 11:55:18

How to update a component if we connect it when we route?

Hello everyone
We have X entities that include Y entities, that is:
X1

  1. Y1
  2. Y2

X2
  1. Y1
  2. Y2

When I move from X1-Y1 to X2-Y2 everything is fine, because I connect another component and the data is pulled from the server, I get new props and so on. But when I move from X1-Y1 to X2-Y1, I actually stay on the same component and therefore React does not see the point in updating the component, that is, pushing new data from other endpoints.
How to solve it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Osher, 2018-09-04
@Nikulio

componentDidUpdate -> prevProps vs props

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question