A single Root component responsible for disparate data like current user, language setting, and theme will become messy and hard to work with. One way to fix this is to move related logic and data into a class, along with a Context Provider to get the data out. In this lesson we’ll group the logic and data for login, and use Context to pass it throughout the app.
Note: The 'before' code for this lesson is the code from the previous lesson.
@Dave thanks Dave, this literally saved me when instead of trying to fix some side effects, I just used context (well understood by your narrative) and hid the implementation detail - and voila!
Hi @Dave, I guess you miss to delete onLogin={this.handleLogin} when you convert it into a function component