soofstad / react-oauth2-pkce

Provider agnostic OAuth2 Authorization Code flow with PKCE for React
MIT License
125 stars 53 forks source link

Bug: Mark react code that need to run on client side with 'use client' #196

Open soofstad opened 2 weeks ago

soofstad commented 2 weeks ago

Code that need to be rendered on client should be marked with 'use client'. See https://react.dev/reference/rsc/use-client#using-third-party-libraries for details.

This will ensure compatibility with frameworks like Nextjs, and react projects using server-side-rendering.

sebastianvitterso commented 2 weeks ago

Does this mean that every related file needs that, or just AuthContext.tsx, since that's the application interface?

soofstad commented 2 weeks ago

This is all a bit new to me. But should only be needed in AuthContext as the rest is included in that.