File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
- import React from "react" ;
1
+ import { ReactElement } from "react" ;
2
2
3
- import SuperTokens from "supertokens-auth-react" ;
3
+ import { EmailPasswordPreBuiltUI } from "supertokens-auth-react/recipe/emailpassword/prebuiltui" ;
4
+ import { canHandleRoute , getRoutingComponent } from "supertokens-auth-react/ui" ;
4
5
5
- export function Router ( ) : React . ReactElement {
6
- if ( ! SuperTokens . canHandleRoute ( ) ) {
6
+ export function Router ( ) : ReactElement {
7
+ if ( canHandleRoute ( [ EmailPasswordPreBuiltUI ] ) ) {
7
8
return < p > An unexpected error has occurred: Unable to handle route</ p > ;
8
9
}
9
10
10
- const component = SuperTokens . getRoutingComponent ( ) ;
11
+ const component = getRoutingComponent ( [ EmailPasswordPreBuiltUI ] ) ;
11
12
12
13
if ( ! component ) {
13
14
return < p > An unexpected error has occurred: Component not found</ p > ;
You can’t perform that action at this time.
0 commit comments