We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Take the following component:
const Button = ({ disabled, onClick }) => ( <button disabled={disabled} onClick={onClick} /> );
This is quite verbose due to the unnecessary repetition of disbabled and onClick.
disbabled
onClick
In JS, we have a similarly verbose syntax which already has a shorthand:
const innerValue = 123; const obj = { innerValue: innerValue, }; // Equivalent to const innerValue = 123; const obj = { innerValue, };
In JSX, it would be nice to be able to do:
const Button = ({ disabled, onClick }) => ( <button {disabled} {onClick} /> );
This avoids collision with the boolean shorthand and feels consistent with the syntax for spreading props ({...props}).
{...props}
The text was updated successfully, but these errors were encountered:
Whoops - looks like this is a duplicate of #23
Sorry, something went wrong.
No branches or pull requests
Take the following component:
This is quite verbose due to the unnecessary repetition of
disbabled
andonClick
.In JS, we have a similarly verbose syntax which already has a shorthand:
In JSX, it would be nice to be able to do:
This avoids collision with the boolean shorthand and feels consistent with the syntax for spreading props (
{...props}
).The text was updated successfully, but these errors were encountered: