DEV Community

Discussion on: React Navigation Bar!

Collapse
 
milan997 profile image
milan997 • Edited

Regarding steps 4 and 5 and how that didn't work for you, try to define your function like this:
handleClick = (e) => { /* code goes here */ }
In this case 'this' keyword will point to the component itself, as you expect, and you don't need to bind the function to the class in the constructor.

Do a research on ES6 arrow functions and lexical this. Bests.

Collapse
 
andersjr1984 profile image
andersjr1984

Oh man, thank you so much for looking at this and replying! I'm super pumped to try this!