Answer the question
In order to leave comments, you need to log in
What is the correct organization of a react-redux application?
Tell.
How to properly organize a react application using react redux
By type ToDo
How to implement the connection of different components?
There is a menu (not navigation, but just a set of goodies, for example, add a note) and the area itself where this note is displayed.
(As it seems to me now, these are definitely components that are not inherited from each other)
So far, only inheritance is in my head.
But if there are a lot of goodies in the menu (add a picture, a timer, a reminder, an article),
then the inheritance will go wild.
And anyway, I think this is a bad idea.
As I see it.
There are two areas (menu and desktop)
The menu, when invoked, launches a specific task component. he sends the result to the desktop and there it is stored (until the first reboot)
And more. I think to take out all the data (menu items for example) in a separate file (a kind of underserver)
Where is it better to communicate with him? I use react-redux
Import it in every file where it is needed I think is not the best option.
Assuming that the structure of the server may be different. then, logically, you need to make one component that will bring this structure into the desired form.
But in the case of redux figs it, you may need to include it in the root file. and in the case of actioncreater, load new data into the reducer....
Answer the question
In order to leave comments, you need to log in
I didn’t understand what kind of inheritance we are talking about, as well as the last paragraphs, the rest seems clear enough, let’s go.
Why not tie this "set of goodies" to "navigation"?
That is, "add note" -> /add, edit -> /edit/:id .. ? In any case, you yourself write about 2 areas that are on all pages, which means you must have a parent component in which the "header (whether it's a menu or not, it doesn't matter) + work area" is rendered
. idea with a router, then the approximate code will be as follows:
...
<HeaderContainer /> // (или тупой <Header />)
{ this.props.children }
...
...
<Route path='/add' component={AddContainer} />
<Route path='/edit/:id' component={EditContainer} />
...
connect(mapStateToProps,mapDispatchToProps)(имя_компонента)
). And further. I think to take out all the data (menu items for example) in a separate file (a kind of underserver)
Where is it better to communicate with him? using react-redux
And I don't even need examples. I want to start stuffing my bumps.
BUT I definitely don’t want to cut the project for a couple of months (the infinitely more complicated toDo) and then understand what I’m used to doing because it’s not necessary.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question