Skip to content

Commit

Permalink
fix(useTree): change 'env.NODE' to 'env.NODE_ENV' (#16630)
Browse files Browse the repository at this point in the history
* fix(useTree): env.NODE -> env.NODE_ENV

* update changelog
  • Loading branch information
YuanboXue-Amber authored Jan 26, 2021
1 parent 1fe1176 commit 89eb6bc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/fluentui/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Remove unsupported values for `size` prop in `Button` component @notandrew ([#16416](https://github.com/microsoft/fluentui/pull/16416))

### Fixes
- Fix `useTree` by changing `env.NODE` to `env.NODE_ENV` @yuanboxue-amber ([#16630](https://github.com/microsoft/fluentui/pull/16630))
- optimize largest icons used by calling @yuanboxue-amber ([#16590](https://github.com/microsoft/fluentui/pull/16590))
- Fix selectable `Tree` where node with unselectable children displaying wrong selection state @yuanboxue-amber ([#16158](https://github.com/microsoft/fluentui/pull/16158))
- Fix screen reader narrates incorrect items count for `toolbar` menu with radio group @yuanboxue-amber ([#15951](https://github.com/microsoft/fluentui/pull/15951))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function useGetItemById(flatTree: FlatTree): GetItemById {
// We are assigning a callback during render as it can be used during render and in event handlers. In dev mode we
// are freezing objects to prevent their mutations
callbackRef.current = itemId =>
process.env.NODE === 'production' ? flatTree[itemId] : Object.freeze(flatTree[itemId]);
process.env.NODE_ENV === 'production' ? flatTree[itemId] : Object.freeze(flatTree[itemId]);

return React.useCallback<GetItemById>((...args) => {
return callbackRef.current(...args);
Expand Down

0 comments on commit 89eb6bc

Please sign in to comment.