You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main purpose for allowing this would be to ease refactoring. If you wish to pull out props into an object, currently you have to change prop={value} to prop: value, for all of them. The syntax above allows simple cut-and-paste.
Edit: OK, so this might be problematic because spaces are currently allowed between < and the tag name. I just never noticed because I never write it that way. Regardless, some sort of JSX object declaration syntax would be nice.
The text was updated successfully, but these errors were encountered:
rchanou
changed the title
Proposal: allow "tagless" elements to represent plain objects
Proposal: allow "nameless" elements to represent plain objects
Feb 11, 2017
Example:
The main purpose for allowing this would be to ease refactoring. If you wish to pull out props into an object, currently you have to change
prop={value}
toprop: value,
for all of them. The syntax above allows simple cut-and-paste.Making JSX more like JS would accomplish the same goal, but this seems less drastic.
Edit: OK, so this might be problematic because spaces are currently allowed between
<
and the tag name. I just never noticed because I never write it that way. Regardless, some sort of JSX object declaration syntax would be nice.The text was updated successfully, but these errors were encountered: