Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React TSX tag params with quotes

Is there any advantage of using single quotation marks over double quotation marks in TSX HTML tags?

Single quotation marks:

<Table aria-label='simple table'>
  ...
</Table>

Double quotation marks:

<Table aria-label="simple table">
  ...
</Table>
like image 645
Socrates Avatar asked Aug 05 '26 09:08

Socrates


1 Answers

according to w3:

By default, SGML requires that all attribute values be delimited using either double quotation marks (ASCII decimal 34) or single quotation marks (ASCII decimal 39). Single quote marks can be included within the attribute value when the value is delimited by double quote marks, and vice versa. Authors may also use numeric character references to represent double quotes (") and single quotes ('). For double quotes authors can also use the character entity reference ".

so it does not matter, choose whatever style you like

like image 188
Secret Keeper Avatar answered Aug 08 '26 02:08

Secret Keeper



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!