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

[docs] Add switches typescript demo #15384

Merged
merged 1 commit into from
Apr 18, 2019
Merged

[docs] Add switches typescript demo #15384

merged 1 commit into from
Apr 18, 2019

Conversation

JarkEMones
Copy link
Contributor

Adding TypeScript example for switches demo.

Issue #14897

@mui-pr-bot
Copy link

No bundle size changes comparing d1f97dc...187de69

Generated by 🚫 dangerJS against 187de69

@eps1lon eps1lon added docs Improvements or additions to the documentation typescript labels Apr 17, 2019
@eps1lon eps1lon self-requested a review April 17, 2019 15:39
@eps1lon eps1lon mentioned this pull request Apr 17, 2019
@eps1lon
Copy link
Member

eps1lon commented Apr 18, 2019

@JarkEMones Much appreciated. Thanks.

checkedB: true,
});

const handleChange = (name: string) => (event: React.ChangeEvent<HTMLInputElement>) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be memoized with useMemo to prevent Switch from re-rendering?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Our components are not memoized by default. Can't use useMemo here anyway it's called dynamically.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation typescript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants