You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For what it's worth, the default @unpic/react component seems to work as a server component.
To Reproduce
Steps to reproduce the behavior:
Create an app router page app/page.tsx
Try to use the nextjs component directly in the page (throws error)
Wrap the nextjs component in a client component (no error)
Expected behavior
If this component is intended to be client-only, this can be fixed by adding 'use client'; to the top of the component file. If not, the component would have to avoid useContext.
Because the docs say that the component doesn't use client-side javascript, my sense is the latter solution is preferred. Otherwise, if the component is only intended for the pages router that would be good to add to the docs.
Desktop (please complete the following information):
OS: linux / Pop!_OS
Browser: Firefox
Version: 0.1.11
The text was updated successfully, but these errors were encountered:
Describe the bug
Importing / using
@unpic/react/nextjs
in an app router page/server component throws the following error.It looks like the next component imports the following, which are not available to server components. See also #639
For what it's worth, the default
@unpic/react
component seems to work as a server component.To Reproduce
Steps to reproduce the behavior:
app/page.tsx
Expected behavior
If this component is intended to be client-only, this can be fixed by adding
'use client';
to the top of the component file. If not, the component would have to avoiduseContext
.Because the docs say that the component doesn't use client-side javascript, my sense is the latter solution is preferred. Otherwise, if the component is only intended for the
pages
router that would be good to add to the docs.Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: