From c37165c844de32b889380122cb42c215640f3ca2 Mon Sep 17 00:00:00 2001 From: daishi Date: Mon, 8 Apr 2024 12:38:57 +0900 Subject: [PATCH] fix(utils): dev-only deprecation message --- src/vanilla/utils/freezeAtom.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vanilla/utils/freezeAtom.ts b/src/vanilla/utils/freezeAtom.ts index 945a3705b2..0c65405490 100644 --- a/src/vanilla/utils/freezeAtom.ts +++ b/src/vanilla/utils/freezeAtom.ts @@ -55,8 +55,10 @@ export function freezeAtom( export function freezeAtomCreator< CreateAtom extends (...args: unknown[]) => Atom, >(createAtom: CreateAtom): CreateAtom { - console.warn( - '[DEPRECATED] freezeAtomCreator is deprecated, define it on users end', - ) + if (import.meta.env?.MODE !== 'production') { + console.warn( + '[DEPRECATED] freezeAtomCreator is deprecated, define it on users end', + ) + } return ((...args: unknown[]) => freezeAtom(createAtom(...args))) as never }