-
Notifications
You must be signed in to change notification settings - Fork 2.9k
fix(react-avatar): Do not render the image when src prop is undefined #28146
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
fix(react-avatar): Do not render the image when src prop is undefined #28146
Conversation
Asset size changesSize Auditor did not detect a change in bundle size for any component! Baseline commit: 0eae1bc208e0d69febb4bc1e70ab1e2c7c96b623 (build) |
Perf Analysis (
|
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| FluentProviderWithTheme | mount | 87 | 90 | 10 | Possible regression |
All results
| Scenario | Render type | Master Ticks | PR Ticks | Iterations | Status |
|---|---|---|---|---|---|
| Avatar | mount | 529 | 573 | 5000 | |
| Button | mount | 277 | 298 | 5000 | |
| Field | mount | 982 | 1024 | 5000 | |
| FluentProvider | mount | 639 | 636 | 5000 | |
| FluentProviderWithTheme | mount | 87 | 90 | 10 | Possible regression |
| FluentProviderWithTheme | virtual-rerender | 80 | 89 | 10 | |
| FluentProviderWithTheme | virtual-rerender-with-unmount | 80 | 75 | 10 | |
| InfoButton | mount | 14 | 14 | 5000 | |
| MakeStyles | mount | 852 | 858 | 50000 | |
| Persona | mount | 1640 | 1604 | 5000 | |
| SpinButton | mount | 1273 | 1254 | 5000 |
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 846ff6d:
|
📊 Bundle size reportUnchanged fixtures
|
🕵 fluentuiv9 No visual regressions between this PR and main |
packages/react-components/react-avatar/src/components/Avatar/useAvatar.tsx
Outdated
Show resolved
Hide resolved
* master: applying package updates doc: Remove wrong recommendation from input (microsoft#28168) fix: Outline color now respects OS force colors settings (microsoft#28182) Datepicker onCalendarOpenStateChange prop (microsoft#28136) feat(react-file-type-icons): Add getFileTypeIconAsUrl utility (microsoft#27336) applying package updates [FIX] Updates selection dot and label positioning for ChoiceGroupOption when an Image or Icon is present. (microsoft#28173) chore(react-infobutton): Rename InfoTip to InfoIcon (microsoft#28177) fix(react-datepicker-compat): Make DatePicker Compat stories SSR safe (microsoft#28017) Added `tab` focus mode to the Breadcrumb (microsoft#28046) docs: Add usable documentation (microsoft#28155) applying package updates Fix up rebase code (microsoft#27864) fix: ContextualMenu indexing in sections (microsoft#28127) applying package updates fix: Layer sets focus visible classname for its FocusRectsProvider (microsoft#28157) docs(react-infobutton): Update stories to show better guidance (microsoft#28144) fix(react-avatar): Do not render the image when src prop is undefined (microsoft#28146) feat(react-datepicker-compat): Add null to value prop and handle controlled cases correctly (microsoft#28056)
|
🎉 Handy links: |
|
🎉 Handy links: |

Previous Behavior
Avatar renders an image even if src is undefined

<Avatar image={{ src: undefined }} />New Behavior
Avatar no longer renders undefined image:
