Skip to content

Commit 92c86f8

Browse files
authored
fix(spin): update deprecation warning for size prop and remove redundant check (ant-design#57812)
1 parent bb126b1 commit 92c86f8

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

components/spin/index.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,6 @@ const Spin: SpinType = (props) => {
147147
// ======================= Size ======================
148148
const mergedSize = useSize((ctx) => size ?? ctx);
149149

150-
if (process.env.NODE_ENV !== 'production') {
151-
const warning = devUseWarning('Spin');
152-
warning.deprecated(size !== 'default', 'size="default"', 'size="medium"');
153-
}
154-
155150
// ======================= Description ======================
156151
const mergedDescription = description ?? tip;
157152

@@ -180,6 +175,7 @@ const Spin: SpinType = (props) => {
180175
if (process.env.NODE_ENV !== 'production') {
181176
const warning = devUseWarning('Spin');
182177

178+
warning.deprecated(size !== 'default', 'size="default"', 'size="medium"');
183179
warning.deprecated(!tip, 'tip', 'description');
184180
warning.deprecated(!wrapperClassName, 'wrapperClassName', 'classNames.root');
185181

0 commit comments

Comments
 (0)