styled-components-ts | Visual primitives for the component age | Frontend Framework library
kandi X-RAY | styled-components-ts Summary
kandi X-RAY | styled-components-ts Summary
Visual primitives for the component age. Use the best bits of ES6 and CSS to style your apps without stress and the added benefits of TypeScript .
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of styled-components-ts
styled-components-ts Key Features
styled-components-ts Examples and Code Snippets
Community Discussions
Trending Discussions on styled-components-ts
QUESTION
maxbause was kind to create a nice boilerplate project for Next.js that includes GraphQL and styled components in TypeScript.
Nonetheless, when I added ESLint to the project I got several warnings and errors because the cause was basically plain JavaScript.
I fixed most of it but I am stuck with two warnings in the _document.tsx file.
First of all, I am getting the following warning on the any part of Document< any>: "Unexpected any. Specify a different type." If I remove any and use nothing, unknown or never then I get errors with the this.props.styleTags.
The second issue is with the Missing return type on function warning thrown by the missing return type in ctx.renderPage = () =>
right after the try where I don't know what I should add.
I am a bit of a noob in TypeScript so please don't be too harsh on me if there is an obvious solution to this. I search quite a bit but couldn't figure it out.
I know I can ignore or even disable these errors but if I am to disable the errors I would appreciate if you could explain why it makes sense to do so.
I hope this question is useful to everyone interested in using Next.js with TypeScript.
_document.tsx (where the warnings are thrown)
...ANSWER
Answered 2020-Apr-06 at 21:35Hope it's still useful to you.
EDIT: I should note that I am not sure if this is the correct typing. However this does silence the TypeScript linter without giving it an implicit any type.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install styled-components-ts
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page