Skip to content

Commit

Permalink
hotfix: usedeprecation warning (aws-amplify#1388)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanksdesign authored Feb 23, 2022
1 parent 3e82f72 commit c65565e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/swift-cups-cheat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@aws-amplify/ui-react": patch
---

Fixes useDeprecationWarning hook
3 changes: 2 additions & 1 deletion packages/react/src/hooks/useDeprecationWarning.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ export const useDeprecationWarning = ({
shouldWarn &&
// show message on builds without Node `process` polyfill
// or with process.env.NODE_ENV not production
(!process || (process && process.env.NODE_ENV !== 'production'))
(typeof process === 'undefined' ||
(process && process.env.NODE_ENV !== 'production'))
) {
console.warn(message);
}
Expand Down

0 comments on commit c65565e

Please sign in to comment.