J
J
J. Snow2020-05-09 20:44:21
React
J. Snow, 2020-05-09 20:44:21

How to store and forward state to child components?

Hi all!

I have a web page written in React. It has a state in which the current user is stored , as well as a set of different utilities for working with the state.

There are different components on the page like Header , Footer Sidebar and so on. They have different logic related to the user and using utilities.

That is, all the components on the page are closely related to each other.

Q:
What options are there for storing and sharing state and utilities?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Egor Telnov, 2020-05-09
@j-snow

- Pass through props to all child elements
-redux/mobx - Pass
through context Lots
of options

M
McBernar, 2020-05-09
@McBernar

Get redux. There will be one common state for all. Well, and your own, if necessary.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question