Syntax highlighting not working when using inline function as an argument(`styled(() => <Foo />)`)
See original GitHub issueTo avoid warning “Received true
for non-boolean attribute XXX”, I’m passing inline function as an argument to styled
function.
const StyledLink = styled(({ primary, ...otherProps }) => <Link {...otherProps} />)`
/* styles */
`
This pattern is useful for avoiding some warnings. (see styled-components #1198 and discussion.) However, when applying this pattern, syntax highlighting is not supported.
Also, I could assign inline function to variable for syntax highlighting.
const StylableLink = ({ primary, ...otherProps }) => <Link {...otherProps} />
const StyledLink = styled(StylableLink)`
/* styles */
`
But, doing so is both costly and cumbersome. It would be great if you’ll support syntax highlighting for this.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:13
- Comments:7 (1 by maintainers)
Top Results From Across the Web
Sphinx inline code highlight - Stack Overflow
syntax_highlight is an ordinary docutils setting, which can be set in docutils.conf . This file is respected by Sphinx too, if placed in...
Read more >API Reference - styled-components
This is a method that creates a new StyledComponent with a different tag or component applied to it, but all the same rules...
Read more >The 10 Most Common JavaScript Issues Developers Face
If you need help figuring out why your JavaScript isn't working, consult this list of the 10 most common JavaScript issues from a...
Read more >Common Lisp Style Guide - Google
We welcome remarks and constructive feedback on how to improve our guide, and on what alternate styles work for you and why. This...
Read more >A case against syntax highlighting - Linus Åkesson
If you color some program in random colors, like you did with your Alice In Wonderland text, it REALLY will be hard to...
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 created a small bounty for this issue (~21 USD). Thanks for the plugin!
Edit: 2020/11/19 the bounty is now showing as 15 USD. Sorry, I’m not sure why it dropped! (If anything, USD has dropped…)
Have a little workaround: