When passing a component as a function, the css markup stops working.
See original GitHub issueThere are certain edge-cases where you must selectively pass props to the component you are styling. This happens, when you are using third party components, that freely forward everything to the dom. So in this case you cannot pass any prop you want to the component, as that results in an error. The issue can be seen discussed here: https://github.com/styled-components/styled-components/issues/135#issuecomment-256018643 https://github.com/couds/react-bulma-components/issues/187
The solution is as such:
const ListElement = styled(({ active, ...rest }) => <Link {...rest} />)
However this makes the markup not work.
Steps to reproduce: Create a styled component const, and use the above code, see, the markup highlighting not work anymore.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:5
Top Results From Across the Web
Complete list of reasons why a css file might not be working
It showed the error: I/O Error: Unknown mime type : text/plain;charset=UTF-8 . It appears both PHP function ( mime_content_type ) and 'file -bi'...
Read more >Handling common HTML and CSS problems - MDN Web Docs
Some problems can be solved by just taking advantage of the natural way in which HTML/CSS work. Unrecognized HTML elements are treated by...
Read more >Solving the React Error: Not Picking Up CSS Style | Pluralsight
In this guide, you will learn about the errors that can occur while importing a CSS file into your React file.
Read more >Not able to import CSS in LWC No MODULE named markup
Indeed, there seem to be a bug with Summer 20 release, when sharing a common CSS file with import function into another LWC...
Read more >How and when to force a React component to re-render
Since the beginning of the web, we've used HTML and CSS to define ... We do this by building components and working with...
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
Fixed in v1.6.0
temporary solution, installation vscode-language-babel then add before the template string
/* CSS */