blitz-js / babel-plugin-superjson-next

Automatically transform your Next.js Pages to use SuperJSON
MIT License
125 stars 15 forks source link

Error with forwardRef #82

Closed LorhanSohaky closed 3 years ago

LorhanSohaky commented 3 years ago
Warning: Function components cannot be given refs. Attempts to access this ref will fail. Did you mean to use React.forwardRef()?

Check the render method of `MyComponent`.
WithSuperJSON@webpack-internal:///./node_modules/babel-plugin-superjson-next/dist/tools.js:110:26
div
div
Skn0tt commented 3 years ago

Hi Lorhan! Could you provide a reproduction case? This error alone makes it very hard for me to grasp what's going on.

LorhanSohaky commented 3 years ago

Here an example

https://user-images.githubusercontent.com/16273730/129623822-c82dcb64-6533-4ddd-b0f0-835cd64bb37b.mp4

example.zip

LorhanSohaky commented 3 years ago

@Skn0tt , if you remove babel-plugin-superjson-next and superjson work correctly

Skn0tt commented 3 years ago

Will be fixed in #88. If you need a workaround until then, try renaming your src/pages/examples folder to something that doesn't include pages.

Skn0tt commented 3 years ago

Published in v0.3.1

LorhanSohaky commented 3 years ago

@Skn0tt , thanks!!