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

Distinguish tags from elements in the terminology #151

Open
tuukka opened this issue Sep 28, 2022 · 0 comments
Open

Distinguish tags from elements in the terminology #151

tuukka opened this issue Sep 28, 2022 · 0 comments

Comments

@tuukka
Copy link

tuukka commented Sep 28, 2022

Has it been a deliberate choice to treat the terms tag and element as synonyms in the spec and the grammar?

jsx/spec.emu

Lines 66 to 71 in d614ce7

JSXElement :
JSXSelfClosingElement
JSXOpeningElement JSXChildren? JSXClosingElement
JSXSelfClosingElement :
`<` JSXElementName JSXAttributes? `/` `>`

I find this lack of distinction confusing when teaching JSX.

I think the following would be more clear and in line with the terminology used for HTML (e.g. Document.getElementsByTagName vs Document.getElementsByName):

      JSXElement :
        JSXSelfClosingTag
        JSXOpeningTag JSXChildren? JSXClosingTag

      JSXSelfClosingTag :
          `<` JSXTagName JSXAttributes? `/` `>`
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

1 participant