Styling a component with forwardRef #1421
Labels
bug report 🦗
Issue is probably a bug, but it needs to be checked
needs: complete repro 🖥️
Issue need to have complete repro provided
platform: next.js 🛠️
Issue related to next.js
platform: ssr 🛠️
Issue related to SSR
Environment
Description
Hi, I'm using Linaria in a Next project via next-with-linaria.
In a file marked with
'use client'
, I have a component defined withforwardRef
that accepts styles:I would like to style this component with Linaria:
This declaration raises an error:
The error seems to happen in Next.js code but is re-thrown by wyw-in-js.
I'm not sure whether my problem is caused by Linaria itself, by next-with-linaria, wyw-in-js or Next.js. I'd appreciate any hints.
Is is possible to wrap a component with forwardRef? Am I fundamentally misunderstanding how Linaria works in a client component?
Thanks for your time and thank you for this project!
Reproducible Demo
Fresh Next.js project with Linaria: https://github.com/molily/next14-linaria
Relevant code is in https://github.com/molily/next14-linaria/blob/main/src/app/ClientComponent.tsx
The text was updated successfully, but these errors were encountered: