From 1ea758f216413eec338b04cc2f622314778a94ce Mon Sep 17 00:00:00 2001 From: devhindo Date: Thu, 17 Oct 2024 12:55:39 +0300 Subject: [PATCH] Update frontend.mdx updated the docs example code to be compatible with React, React Router and Supertokens latest versions --- .../pre-built-ui/setup/frontend.mdx | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/v2/thirdpartyemailpassword/pre-built-ui/setup/frontend.mdx b/v2/thirdpartyemailpassword/pre-built-ui/setup/frontend.mdx index 03e0bc0f9..76ca4776a 100644 --- a/v2/thirdpartyemailpassword/pre-built-ui/setup/frontend.mdx +++ b/v2/thirdpartyemailpassword/pre-built-ui/setup/frontend.mdx @@ -495,22 +495,17 @@ import { getSuperTokensRoutesForReactRouterDom } from "supertokens-auth-react/ui ^{prebuiltuiimport} import * as reactRouterDom from "react-router-dom"; -class App extends React.Component { - render() { - return ( - - - - {/*This renders the login UI on the ^{form_websiteBasePath} route*/} - // highlight-next-line - {getSuperTokensRoutesForReactRouterDom(reactRouterDom, [^{recipePreBuiltUINameCapitalLetters}])} - {/*Your app routes*/} - - - - ); - } -} +createRoot(document.getElementById('root')!).render( + + + + {getSuperTokensRoutesForReactRouterDom(reactRouterDom, [ThirdPartyPreBuiltUI, EmailPasswordPreBuiltUI])} + } /> {/*or other routes*/} + + + +, +) ```