I am working on a Next.js project, and I need to convert a styled-components CSSObject into an inline tag. However, I do not want to use any React context for this purpose.
I tried the following code:
import { css } from 'styled-components';
css({});
But I encountered the following error:
Error: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more: https://nextjs.org/docs/messages/context-in-server-component
It appears that the styled-components library relies on a context that only functions in client components, but I am aiming for a server-side approach or any other method that doesn't involve React context.
How can I convert a styled-components CSSObject into an inline tag without using any React context?