M
M
Maxim Korolsky2016-08-04 01:11:30
React
Maxim Korolsky, 2016-08-04 01:11:30

How to respond to changes in children?

There is a route profile, I connect to it redux. He has children profile/edit и profile/add, I separately connect redux to them.
And so these children in a modal window over profilea page are displayed. In profileI added {this.props.children}
Loading profile, I see the spinner spinning, and that's all. Because when the statechildren are updated, the component is not updated, and when the stateparent is updated, then everything is fine.
You can receive state in the parent and pass it through cloneComponent. So far this is the only option I see.
Maybe there is something else?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikolai Antonov, 2016-08-04
@my-nickname

Maybe try with event-emitter or PubSub . Generate an event and a subscription to it, and pass everything you need as a parameter.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question