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

Consider including difference between <tag> and <Component> in spec #29

Closed
glenjamin opened this issue Mar 2, 2015 · 5 comments
Closed
Labels

Comments

@glenjamin
Copy link

This arose in relation to eslint/eslint#1911

Currently, the spec has a single node type for JSXElementName, which separates three cases: identifier, xml-namespaced identifier, JS member expression identifier.

In the implementation as of 0.12, the semantics of a tag differ depending on the casing of the first character of the identifier.

Could this be incorporated in some way? Perhaps as JSXComponent vs JSXIdentifier or JSXIdentifier vs JSXTag. Something to indicate that one should be interpreted as a variable reference, and one as a string literal.

@sebmck
Copy link

sebmck commented Mar 2, 2015

The JSX spec purposely doesn't define semantics. It's meant to be agnostic and <Component> does not necessarily have to reference a variable.

@glenjamin
Copy link
Author

In practice, JSX implementations which are "React-agnostic" currently special-case the <tag> forms.

While this remains unspecified, core tooling like eslint & babel are in a bit of a halfway house where React-specific semantics around variables are hard-coded, but not the resulting transform.

@sebmck
Copy link

sebmck commented Mar 2, 2015

@glenjamin Babel isn't a valid comparison since it specifically targets the React flavour of JSX.

@ghost
Copy link

ghost commented Aug 4, 2015

Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed.

@Huxpro
Copy link
Contributor

Huxpro commented Feb 25, 2022

Closed because this is intentional.

@Huxpro Huxpro closed this as completed Feb 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants