Are you an LLM? You can read better optimized documentation at /docs/guide/usage/linter/rules/react/jsx-no-comment-textnodes.md for this page in Markdown format
In JSX, any text node that is not wrapped in curly braces is considered a literal string to be rendered. This can lead to unexpected behavior when the text contains a comment.
react/jsx-no-comment-textnodes Suspicious
What it does
This rule prevents comment strings (e.g. beginning with
//or/*) from being accidentally injected as a text node in JSX statements.Why is this bad?
In JSX, any text node that is not wrapped in curly braces is considered a literal string to be rendered. This can lead to unexpected behavior when the text contains a comment.
Examples
Examples of incorrect code for this rule:
Examples of correct code for this rule:
How to use
To enable this rule using the config file or in the CLI, you can use:
References