no-raw-text doesn't work for custom styled components
See original GitHub issueUnless I’m doing something wrong, the no-raw-text rule doesn’t seem to work when using styled-components. This makes it largely useless I think? Would be nice to be able to use this rule but not sure how to do so when using styled-components.
import styled from 'styled-components/native';
let view = () => (
<MyText>This doesn't work</MyText>
);
const MyText = styled(Text)`
font-size: 16;
`;
Issue Analytics
- State:
- Created 4 years ago
- Reactions:12
- Comments:10
Top Results From Across the Web
Extending styles with styled-components not working
The styled method works perfectly on all of your own or any third-party components, as long as they attach the passed className prop...
Read more >Style your React Components like a Boss with ... - Codementor
styled -components exposes a React Context that works wonderfully with every component you build. You can create a theme object and use it ......
Read more >Demystifying styled-components - Josh W Comeau
In this post, we'll learn exactly how styled-components works by building ... You don't need to understand how cars work in order to...
Read more >How to use styled-components with React Native
styled -components is a CSS-in-JS library that is open source and allows you, ... Creating custom components in any React or React Native...
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 Free
Top 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
Also running into this. One possible option to fix it would be to change the
skip
option to accept a regex instead of (or in addition to) an array of strings, so that you could do, for example:to skip any component that is suffixed with
Text
.Same problem… My codebase is using a lot of Typograph components made with
styled-components
and unfortunately, I had to disable this rule