corbado / javascript

MIT License
11 stars 2 forks source link

Include "use client" directive #358

Open lukaskratzel opened 4 months ago

lukaskratzel commented 4 months ago

Why

Integrating Corbado components in Next.js via @corbado/react currently requires a wrapper file with the 'use client' directive on the top. Most React libraries relying on client-side features like state have included that directive in their components so they don't require a wrapper and can just directly be imported into server component files.

I see special importance in PasskeyList and CorbadoProvider as they usually are used in server components. Authentication related components are less important as they use client side logic (e.g. for routing) anyways most of the time and thus need to be put into a "use client" file anyways

TODOS

Here you must list all the TODOS using TODO checkboxes (markdown).

Acceptance criteria

Here you must define the acceptance criteria of this issue (what has to work, what should the developer test and so on). Use TODO checkboxes (markdown).

Aby-JS commented 3 months ago

@lukaskratzel I checked after adding use client on the @corbado/react components. We still need to add use client on their wrappers in NextJS application.