-
Notifications
You must be signed in to change notification settings - Fork 13.8k
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
Add React to update folder #2202
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.
Thank you @flashdesignory for the amazing work, I would love to get your thoughts on the comments I left. I think this should be our new official React implementation since most people now use hooks to create their react app and it should also replace the current react-hooks example but I believe we would still need an updated react app that uses class components
- [React](https://reactjs.org/) is a JavaScript library for creating user interfaces. | ||
|
||
## Implementation details | ||
|
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 think it would be beneficial to add a one-liner to mention that React is primarily considered a view library. However, when combined with other tools it can be a part of an MVC architecture
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 added something... let me know if that works!
}; | ||
|
||
export function Input({ onSubmit, placeholder, label, defaultValue, onBlur }) { | ||
const handleBlur = useCallback(() => { |
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 believe using useCallback isn't necessary here, what are your thoughts regarding this ?
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.
We did measure a performance gain by using it here.
This version has been lifted from Speedometer and follows the WebKit styles guide.
Implementation details: React 17, functional components & hooks...
For more context regarding this update, please view #2199.
@FadySamirSadek - we'd need to see what current version(s) this would replace.
@kara