This is undefined

I am using a toggled pulldown menu in my navbar. This is a component that is displayed if the user clicks on the menu icon or on the user name. I use it in several screens but if I divert to another screen with this navbar the menu does not display anymore.
I debugged it and found that the this object is undefined in the called screen (please see screen print below).

Is that because a component only gets instantiated once and has only one state in the whole app? How can I get around this?


Can you post an link to example React Studio project file (extension .rsproj) which has only your custom menu component and couple screens.

Btw. have you tried the React Studio’s standard menu instead of your custom one?

Thanks Antti, but I resolved it already.
It was actually my mistake - I did not have enough space on some screens so that it could have been displayed.

1 Like