Forum Discussion
lazycipher
Feb 25, 2021Copper Contributor
Detection of whether react app is running in Teams or Web browser?
Currently, I'm trying to get context using getContext() and trying to decide whether it's running in Teams or Browser.
Is there any other better way to move ahead with this?
- Nikitha-MSFTMicrosoftYes, get context will work on browser. Are you facing any issue? Could you please share more details?
- lazycipherCopper Contributor
Actually, the callback inside getContext() is not being executed when the website is being opened in the browser. Please see this once -> https://stackblitz.com/edit/react-cuadoi?file=src%2FApp.js
- Nikitha-MSFTMicrosoftWhere did you assign the value to the teamscontext variable? Could you please try printing the context directly using console and check in dev dev tools?