M
M
mr jeery2018-02-14 21:29:08
JavaScript
mr jeery, 2018-02-14 21:29:08

What is the best way to pass the state of the component to the database?

I wrote an application in pure React, in which an arbitrary number of cards are created, and an arbitrary number of entries are created in the cards. All data is stored in the cards array, which is in the state of the main component.
Data is transferred to other components one by one, descends, ascends, everything seems to be fine, it works, I'm glad.
5a847fe96d320177630359.png
Now I want to add express and mongodb to the project in order to save and load postcards.
I found examples on the react-mongo git and everywhere the interaction with the server is built through flux or redux.
Doubts began to arise as to how to implement everything correctly. Redux project redux?
Do a separate action and reducer to add a card, an entry with a store entry?
Or is it possible to make one action-reducer for loading and unloading to the server in the database of the entire cards array in state ?
And if so, can you suggest an approximate procedure?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
C
Coder321, 2018-02-14
@Coder321

If something goes wrong, you can screw redux, and send and receive data with the usual fetch.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question