no-raw-text does not properly consider Animated.Text
See original GitHub issueThe following code:
<Animated.Text>Some Text</Animated.Text>
Triggers this error:
error Raw text Some Text cannot be used outside of a <Text> tag react-native/no-raw-text
This should not create an error as Animated.Text is a Text tag
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:12 (3 by maintainers)
Top Results From Across the Web
Issue with animated text not wiping in correctly
Hi all, I have a project which was started in Storyline 2 and have since brought into Storyline 3, and now there is...
Read more >Animated Text Spacing | After Effects Tutorial - YouTube
In this After Effects tutorial, learn how to animate text spacing (tracking or kerning) and use dynamic linking to bring your composition ...
Read more >How to Add Animation to Text (Without After Effects) - YouTube
In this video, you'll learn how to easily create animated text without using After Effects. Try our animated text maker ...
Read more >Animating text in After Effects
Animate the Transform properties, as you would any other layer, to change the entire layer, not its text contents. Apply text animation presets....
Read more >How to animate/transition text value change in SwiftUI
If you want to fade out the old value as well, it won't be that hard to customize the modifier. Also since your...
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
You can add this to your .eslintrc for a short term fix @holden-caulfield
‘react-native/no-raw-text’: [ 2, { skip: [‘H1’, ‘H2’, ‘H3’, ‘Animated.Text’], }, ],
I use NativeBase so the h1, h2, h3 also fit this
I agree the rule needs to be adjusted to fix these by default rather than needing the skip setup though.
I know this change has already been merged so maybe this should be brought up in a new issue but, am I the only one who would like some kind of wildcard matching?
Ideally I’d like an option to suppress errors if the component name ends with Text. There are a number of places in my code where I will use styled to create various Text components with different styling. The names can vary but generally always end with Text. There may be reasons why this shouldn’t be the default behaviour but as an opt-in I can’t see it causing any pain. Another option would be to allow regex to be passed to skip.
Happy to have a look at implementing this if it’s likely to get merged.