M
M
Maxim2015-09-18 22:57:12
JavaScript
Maxim, 2015-09-18 22:57:12

How to navigate to another page in React?

Hello.
The project uses react + flux.
There is a data table, when you click on an element from the table, we go to the element editing page. After saving, flux works (action -> store). Table and edit page are different components.
Tell me how to return to the page with the table after saving it in the Store?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim, 2016-05-11
@maxfarseer

Here it would be more correct to do this:
the parent component renders both the table and the "edit page", and you have a variable in the store, for example: edit , if true -> the "edit page" is rendered, if false - the table is rendered.
When you click on a row in the table, an action (action) is generated, which, in combination with other actions (which you already have), changes edit
. The parent component must be subscribed to store.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question