This should be sufficient and produce the results. Just point your api accordingly (for your env you’ll likely need some adjustments due to the different ports
←[32mINFO←[0m: Started server process [←[36m13092←[0m]
←[32mINFO←[0m: Waiting for application startup.
←[32mINFO←[0m: Application startup complete.
←[32mINFO←[0m: Uvicorn running on ←[1mhttp://127.0.0.1:8000←[0m (Press CTRL+C to quit)
←[32mINFO←[0m: 127.0.0.1:58448 - "←[1mOPTIONS /api/teleporters HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m: 127.0.0.1:58448 - "←[1mOPTIONS /api/teleporters HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m: 127.0.0.1:58448 - "←[1mGET /api/teleporters HTTP/1.1←[0m" ←[32m200 OK←[0m
←[32mINFO←[0m: 127.0.0.1:58451 - "←[1mGET /api/teleporters HTTP/1.1←[0m" ←[32m200 OK←[0m
observe developer console output on browser
Warning: Can't perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in a useEffect cleanup function.
at ProtectedPage (http://localhost:3000/static/js/bundle.js:3006:80)
at WithAuthenticationRequired (http://localhost:3000/static/js/bundle.js:8611:14)
I can reproduce this issue with all of the Hello World API code samples I’ll investigate further. Thanks for pointing it out! I’ll create a report on this and share it with the SDK Team
@dan-auth0 Thanks for your hard work on this. The original article (on which we’re commenting) didn’t use TypeScript. Do you anticipate putting together a code sample for React Router 6 and JavaScript?
As other commenters have pointed out, the original documentation was written without Typescript. While I was able to figure it out with the help of @o.o post, I think this highlights that there are two audiences,
New Auth0 users who are starting fresh with this article.
Current Auth0 developers upgrading old React projects. This article is a bit lacking for these users.
I’m not sure if a completely new article is required, but I see a need to help users through the upgrade process.
My Upgrade Journey:
I ran into the following “gotchas” while upgrading our project to React-Router to V6. I don’t think all of these need to be included in an Auth0 article, but someone may run into a similar problem so I’ll log them here. Referencing this documentation is a must:https://reactrouter.com/docs/en/v6/upgrading/v5
Nested Routes
Nested routes function differently in React-Router V6, users will need to pay special attention to their syntax while writing any nested routes.
New Method
Old Method
useParams replaces props.match.params
This was a nasty one. I think useParams was released in V5.1, but our project was still using props.match.params before this update. Uses will need to import useParams with react-router-dom and update any props.match.params with the new syntax. This post was helpful: reactjs - How to pass params into link using React router v6? - Stack Overflow
Thanks for this feedback. We were discussing earlier this afternoon about how to better structure React content. I can share the following plan with y’all:
A new Developer Guide will replace the Complete Guide. It will match the style and UX of the new Developer Hub site.
This guide would use JavaScript, React Router v5 and I think React v17. I think it’s worth to upgrade React.
A new Developer Guide to migrate a project that uses Auth0 from React Router v5 to React Router v6
This guide would use JavaScript and React v17.
A new Developer Guide that shows how to migrate a JavaScript project that uses Auth0 into a TypeScript project.
This would use React Router v7
I don’t think that we need directly a TypeScript guide for now as there is a TypeScript code sample to use as reference as someone follows the JavaScript Authentication guide. Also, the migration guide to TS would help fill any gaps.
The Hello World React apps are simple so I am not sure if we’ll get to explore all those features of React Router in general. However, I have plans to build and publish more complex examples to showcase features such as Auth0 Organizations, Auth0 Actions, and Fine-Grained Authorization. I think those more complex samples will allow us to show developers how Auth0 integrates with their tools to solve more intricate problems faster.
It cool to be here…
I need a guideline on fingerprint & barometric integration on web. Am on a reactJS project where I need to enroll user’s registration data with their barometric (Via any External Fingerprint device) … have search through the internet but am yet to get a direct solution that works smooth with JavaScript or reactJS.
Ff Auth0 can solve this what are the steps I need to take to integrate it?
Thanks.
I’ll be working on that material this quarter. There’s an issue that @o.o spotted that I have been researching and documenting. I’ll be sharing that report with the Auth0 SDK Team
What do the typical timelines look like for this type of patch for the SDK team out of curiosity – would love to delete out my ugly code that gets around the issue :).
No specific timelines I am still exhausting some paths and pattern to submit a report to that team. On the meantime, if you’d like, you can also open an issue under the React SDK repo or comment on an existing one that addresses this concern.