From ffe085c95d12d5c44a7d6fa585210f96e51f9a98 Mon Sep 17 00:00:00 2001 From: Alan Poulain Date: Mon, 13 Jan 2020 14:51:09 +0100 Subject: [PATCH] Show deprecated messages only in dev --- packages/react-admin/src/Admin.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-admin/src/Admin.tsx b/packages/react-admin/src/Admin.tsx index 812370ce6cf..2862340bc99 100644 --- a/packages/react-admin/src/Admin.tsx +++ b/packages/react-admin/src/Admin.tsx @@ -104,7 +104,7 @@ const Admin: FunctionComponent = ({ theme, title = 'React Admin', }) => { - if (appLayout) { + if (appLayout && process.env.NODE_ENV !== 'production') { console.warn( 'You are using deprecated prop "appLayout", it was replaced by "layout", see https://github.com/marmelab/react-admin/issues/2918' ); @@ -114,7 +114,7 @@ const Admin: FunctionComponent = ({ 'You passed true to the loginPage prop. You must either pass false to disable it or a component class to customize it' ); } - if (locale) { + if (locale && process.env.NODE_ENV !== 'production') { console.warn( 'You are using deprecated prop "locale". You must now pass the initial locale to your i18nProvider' );