-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Cannot wrap the application to properly work with server-side rendering for Nextjs and error on type with styled-tools #331
Comments
Hi @mimiqkz thanks for opening this issue! Are you able to share a codesandbox with the code that is failing? 🤔 the linked one is the example. Also, looks like you are defining types for |
@cristianbote Yes, here is something https://codesandbox.io/s/brave-proskuriakova-i4ews?file=/pages/index.tsx |
@cristianbote any news on this? |
Hey @mimiqkz I did not had a chance to look into it. But quick question does this fails for you because of the type error? Or it fails because of something else? To overcome that error quickly you could mark it optional for the const Wrapper = styled("footer")<{theme?: string}>`
// [...]
` |
@cristianbote Hello, I wanted to use So does that mean I can not use |
Hey @mimiqkz you can try improving the typing.
|
I have been trying to find a way for wrap the application to use with Nextjs. I followed the example shows in here https://codesandbox.io/s/eager-cherry-57c9u?file=/pages/_document.js.
However, it doesn't seem to work when you're doing it with typescript
Also I got this error upon trying to use styled with styled-tools.
![image](https://user-images.githubusercontent.com/19761446/122826536-cd0bcd80-d2d2-11eb-9382-5665ce97c85d.png)
Property 'theme' is missing in type '{ children: Element; }' but required in type 'Omit<ClassAttributes<HTMLElement> & HTMLAttributes<HTMLElement> & DefaultTheme & { theme: ThemeWithPalette; tone?: number | undefined; }, never>'.
The text was updated successfully, but these errors were encountered: