From 5827f9ddef33e8b3d9eff7da52083abfc112e8b0 Mon Sep 17 00:00:00 2001 From: Zack Chang <73225408+jrr997@users.noreply.github.com> Date: Sun, 25 Jun 2023 10:14:41 +0800 Subject: [PATCH] refactor: resolve useSize circular reference (#42810) --- components/config-provider/SizeContext.tsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/components/config-provider/SizeContext.tsx b/components/config-provider/SizeContext.tsx index b4b8b0049a..5bc5924017 100644 --- a/components/config-provider/SizeContext.tsx +++ b/components/config-provider/SizeContext.tsx @@ -1,5 +1,4 @@ import * as React from 'react'; -import useSize from './hooks/useSize'; export type SizeType = 'small' | 'middle' | 'large' | undefined; @@ -11,8 +10,8 @@ export interface SizeContextProps { } export const SizeContextProvider: React.FC = ({ children, size }) => { - const mergedSize = useSize(size); - return {children}; + const originSize = React.useContext(SizeContext); + return {children}; }; export default SizeContext;