D
D
Damir Balgabaev2020-02-20 19:28:42
JavaScript
Damir Balgabaev, 2020-02-20 19:28:42

How to access the Redux Store when the component is not in the Provider?

I am learning to work in React Native. I am authorizing. I have 2 navigators: one before authorization, the second with authorization. After authorization, App displays 2 navigator. The authorization data is in the Redux Store. If you try to get through useSelector it gives an error that the provider was not found.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
abberati, 2020-02-20
@abberati

Your entire application must be wrapped in a provider. This is usually done in the root component itself. Without a provider, you can access the store, but this is a crutch - you don’t need to do this.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question