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
Styled component not applying styles #3149
Comments
This might be caused by the patch version mismatch after bump on Example of a resolution by bun
Unsure why this happens, didn't have time to investigate.
"overrides": {
"@emotion/react": "11.11.1"
},
"dependencies": {
"@emotion/react": "11.11.1",
"@emotion/styled": "^11.11.0"
} |
See: https://emotion.sh/docs/styled#styling-any-component Your component needs to have a const errorMsg = ({ children, className }) => {
return (
<span className={`zds-error inline-flex ${className}`}>
<span>{children}</span>
</span>
);
}; The basic idea is that the class needs to be attached to a DOM tag element to work. |
Current behavior:
Have used styled to style the contents of a component. But it is not working.
In the code, have created a small component and styled it to be color red. But its not applying.
Codesandbox: https://codesandbox.io/p/sandbox/styled-component-demo-gtvf4l
Expected behavior:
Red color is applied to the component
Environment information:
"@emotion/react": "^11.11.3",
"@emotion/styled": "^11.11.0",
The text was updated successfully, but these errors were encountered: