Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nested Text component recognized as raw text #42

Open
wpyeon opened this issue Jun 21, 2023 · 1 comment
Open

Nested Text component recognized as raw text #42

wpyeon opened this issue Jun 21, 2023 · 1 comment

Comments

@wpyeon
Copy link

wpyeon commented Jun 21, 2023

"react-native/no-raw-text": "error",

I have trouble passing the lint test due to error when I nest a Text component inside another Text component:

<View>
  ...
  <Text style={styles.footnoteText}>
    {'*Only receipt scanning is available in the app.\n'}
    {'For other document types, please '}
    <Text style={styles.contactUsHyperlink} onPress={openURL}>
      {'contact us'}
    </Text>
    {'.'}
  </Text>
  ...
</View>

Error message:

error  Raw text (*Only receipt scanning is available in the app.) cannot be used outside of a <Text> tag  react-native/no-raw-text
@louischan-oursky
Copy link
Collaborator

It is a bug of the underlying eslint-plugin-react-native. But it has not been updated for a while. I guess you can disable this rule on that line with // eslint-disable-next-line react-native/no-raw-text. For details, see Disabling rules. When I have time, I would drop eslint-plugin-react-native and adopt @react-native-community/eslint-config instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants