Skip to content

Commit

Permalink
Fix styles debugging throw error under dev environment (#18955)
Browse files Browse the repository at this point in the history
* fix resolvedStylesDebug

* changelog
  • Loading branch information
YuanboXue-Amber committed Jul 15, 2021
1 parent 445c04a commit 7ca92e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions packages/fluentui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Fix `Tooltip` trigger order of props being spread @chassunc ([#18875](https://github.com/microsoft/fluentui/pull/18875))
- Ensure wide content fits in compact ChatMessage @Hirse ([#18871](https://github.com/microsoft/fluentui/pull/18871))
- Adding back data-is-focusable attribute for `menuitem` @kolaps33 ([#18934](https://github.com/microsoft/fluentui/pull/18934))
- Fix style debugging throw error in dev environment @yuanboxue-amber ([#18955](https://github.com/microsoft/fluentui/pull/18955))
- Fix `ChatMessage` to pass `popperRef` from user to `usePopper` @yuanboxue-amber ([#18950](https://github.com/microsoft/fluentui/pull/18950))

### Features
Expand Down
8 changes: 4 additions & 4 deletions packages/fluentui/react-bindings/src/styles/resolveStyles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,8 @@ export const resolveStyles = (
}

if (process.env.NODE_ENV !== 'production' && isDebugEnabled) {
resolvedStylesDebug[slotName] = (resolvedStyles[slotName] as any)['_debug'];
delete (resolvedStyles[slotName] as any)['_debug'];
resolvedStylesDebug[slotName] = (resolvedStyles[slotName] as any)?.['_debug'];
delete (resolvedStyles[slotName] as any)?.['_debug'];
}

if (telemetry?.enabled && telemetry.performance[primaryDisplayName]) {
Expand Down Expand Up @@ -335,8 +335,8 @@ export const resolveStyles = (
}

if (process.env.NODE_ENV !== 'production' && isDebugEnabled) {
resolvedStylesDebug[slotName] = (target[slotName] as any)['_debug'];
delete (target[slotName] as any)['_debug'];
resolvedStylesDebug[slotName] = (target[slotName] as any)?.['_debug'];
delete (target[slotName] as any)?.['_debug'];
}

if (telemetry?.enabled && telemetry.performance[primaryDisplayName]) {
Expand Down

0 comments on commit 7ca92e7

Please sign in to comment.