From 4efd8fb92febe2cdda76c82200d4476fe75ed1ad Mon Sep 17 00:00:00 2001 From: neverland Date: Fri, 16 Oct 2020 20:22:44 +0800 Subject: [PATCH] fix(Icon): add info prop deprecation warning (#7347) * fix(Icon): add info prop deprecation warning * chore: adjust --- src/icon/index.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/icon/index.tsx b/src/icon/index.tsx index d9962dfa1..3c931b3f1 100644 --- a/src/icon/index.tsx +++ b/src/icon/index.tsx @@ -50,6 +50,12 @@ function Icon( const name = correctName(props.name); const imageIcon = isImage(name); + if (process.env.NODE_ENV !== 'production' && props.info) { + console.warn( + '[Vant] Icon: "info" prop is deprecated, use "badge" prop instead.' + ); + } + return (