https://supertokens.com/ logo
Title
t

tonyb

12/20/2022, 5:00 AM
hello, how do we add custom react component? I get this error when trying:
n

nkshah2

12/20/2022, 5:01 AM
Hi @tonyb Can I see the code for what you tried?
t

tonyb

12/20/2022, 5:02 AM
hi
I call this fn in my form
n

nkshah2

12/20/2022, 5:02 AM
Where do you call
SuperTokens.init
?
t

tonyb

12/20/2022, 5:02 AM
_app.tsx
js
if (typeof window !== 'undefined') {
  // we only want to call this init function on the frontend, so we check typeof window !== 'undefined'
  SuperTokensReact.init(frontendConfig());
}
n

nkshah2

12/20/2022, 5:03 AM
Can I see the imports for
createCode
and
PasswordlessReact
t

tonyb

12/20/2022, 5:04 AM
form is very simple, onsubmit call the sendotp function with email
n

nkshah2

12/20/2022, 5:05 AM
Also the import for
createCode
t

tonyb

12/20/2022, 5:05 AM
ah good call
it was importing the web version
n

nkshah2

12/20/2022, 5:06 AM
Ah, changing the import should fix it then
t

tonyb

12/20/2022, 5:06 AM
yes works 🙂
thank you
n

nkshah2

12/20/2022, 5:06 AM
Happy to help