Support passing type parameters to styled function
See original GitHub issueTypeScript 2.9 will support passing type parameters to tagged template literals, i.e.
styled<Props>`
color: black;
`;
will become valid. The plugin should support this syntax and trigger the syntax highlighting.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:28
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Passing in parameter to Styled Components - Stack Overflow
You can pass an argument with Typescript as follows: <StyledPaper open={open} /> ...
Read more >Advanced Usage - styled-components
styled -components has full theming support by exporting a <ThemeProvider> wrapper component. ... You can also pass a function for the theme prop....
Read more >typing — Support for type hints — Python 3.11.1 documentation
Source code: Lib/typing.py This module provides runtime support for type hints. ... In the function greeting , the argument name is expected to...
Read more >8 awesome features of styled-components - LogRocket Blog
Props can be passed to styled components just as they are with regular React components (class or functional). This is possible because styled...
Read more >Google C++ Style Guide
Inputs and Outputs; Write Short Functions; Function Overloading; Default Arguments; Trailing Return Type Syntax. Google-Specific Magic.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I think a more likely use case is
styled.tag<Props>`...`
rather thanstyled<Props>`...`
Example:
Current look in VSCode:
(the first block is highlighted and the second one is not)
Types in template literals work for me in
next@7.0.0-canary.0
+@zeit/next-typescript@1.1.1-canary.2
🎉 This means that they may be widely used soon after the release of 7.0.0 😉Hi all,
Any update on this issue? As you can see in the image the
Container
is higlighted correctly, whileItem<Props>
is not. 😞This is the stack I’ve been using