0

I have just added eslint-plugin-react to my react project, while I'm trying to add a button to my project like this:

<button type="submit">submit</button>

eslint starts to blame the code style and throws the following error:

  Line 46:55:  Strings not allowed in JSX files: "submit"  react/jsx-no-literals

any idea on this? any ideas and suggestions would be appreciated :)

Emad Baqeri
  • 2,333
  • 2
  • 14
  • 29
  • It probably wants you to write `{"submit"}` instead. "submit" would be a string literal in the jsx, but anything in the braces {} is javascript. – windowsill Nov 21 '21 at 00:48
  • this is the output while I'm doing it as you said ```Line 47:11: Curly braces are unnecessary here react/jsx-curly-brace-presence``` – Emad Baqeri Nov 21 '21 at 19:13
  • It's referring to the other submit. . Btw I just googled "react/jsx-no-literals" and all the info about the lint rule came up with examples and everything. – windowsill Nov 22 '21 at 06:45
  • @windowsill finally I have managed to solve it by reading the GitHub repository, by the way thank you relly much ;) – Emad Baqeri Nov 22 '21 at 10:18

0 Answers0