-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warning using assignInlineVars
in RSC (Next.js)
#1246
Comments
Just bumping this and adding another example. Running following code in Next.js 14 produces a React 418 error <div style={assignInlineVars({[styles.blockContainerTextAlign]: children.length === 1 ? 'center' : ''})}> However, updating it to the following fixes it. It seems that the empty string <div style={assignInlineVars({[styles.blockContainerTextAlign]: children.length === 1 ? 'center' : 'unset'})}> |
This can be fixed by using method below |
Any news about this? As a solution for now we just spread the result from <div style={{...assignInlineVars({[myVar]: 'myStyle'})}} /> It works, but would be nice to not have to spread it here and create a new object for this. |
I patched my
from: And it works like a charm now since I am using typescript and not converting |
Describe the bug
When using
assignInlineVars
function:React warns you about not being able to pass non plain objects between Server and Client components.
The problem is the object created by
assignInlineVars
has a.toString()
methodReproduction
https://github.com/atabel/next-vanilla-extract
System Info
Used Package Manager
yarn
Logs
Validations
The text was updated successfully, but these errors were encountered: