-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
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
[docs] Migrate batch of demos to hooks/typescript #16003
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work! Just a few things that I think should be changed :)
state = { | ||
checked: false, | ||
}; | ||
function SimpleCollapse() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a preference can you make the function arrow functions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at the other demos, this is they way it's done in those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, seems like there's a mix then. It should be fine to leave this as is then. I'm not sure which syntax we are preferring cc @oliviertassinari @eps1lon
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really don't care. As long as both are named and no this
is used inside the body they should be equivalent. Is there an observable difference between arrow functions and function declarations in this case?
No bundle size changes comparing b0c846a...e01a721 |
Could you add a quick summary so that I can update #14897? |
@eps1lon Done |
@merceyz Much appreciated, thanks! |
Migrated the following demos to hooks/typescript: