S
S
Sergey Abramov2020-06-14 02:45:46
React
Sergey Abramov, 2020-06-14 02:45:46

Is it possible to set connect to individual blocks?

Hello. I'm a complete newbie, so this is probably a very dumb question.

There is a login page

<header/>
<loginContent>
  //тут connect и вся логика
<content/>
<footer/>

is it possible to make another connect in the header so that it catches the change in information about users entering / exiting. Or is the only implementation possible:
<loginContent>
<header auth={auth} logout={logout()}/>
//контент
<footer/>
<content/>


How to do it right?

ps: I tried to add a connection to the header, it gives an error Warning: Cannot update a component (`ConnectFunction`) while rendering a different component (`Header`). To locate the bad setState() call inside `Header`, follow the stack trace as described in https://fb.me/setstate-in-render

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question