Auth0 in a TypeScript React environment

I follow the quick start for react with the only modification is that I am in a TypeScript environment. But it seems that including the @auth0/auth0-react package causes a compile error My app throws a syntax error as it cannot recognize the character ‘!’.

CompileError

Hey there!

In order to handle that most effectively can I ask you to open a GitHub issue in the react repo that you’re using so we can clarify that with the repo maintainer? Thanks! Make sure to share the link to the issue with us so we can ping them!

Hi @rkevinburton - repo maintainer here :wave: - yes, please open an issue with a link to your app’s code if possible and we’ll get to the bottom of it

2 Likes

Howdy! I just found this issue while searching for questions related to React + TypeScript + Auth0.

You can consult these code samples if you still need assistance with setting up or troubleshooting your Auth0 TypeScript integration with React:

You can use them as starting points on how the integration could look like and help you troubleshoot any issues you may be facing.

I plan to create a React code sample that uses React Router v6 this week and next. :pray:

1 Like