From 506eb1299f0668a36124eb002b9d77e374e39593 Mon Sep 17 00:00:00 2001 From: janrywang Date: Thu, 21 Oct 2021 20:21:41 +0800 Subject: [PATCH] chore(antd/next): improve code --- packages/antd/src/form-layout/index.tsx | 2 +- packages/antd/src/form-layout/useResponsiveFormLayout.ts | 4 +--- packages/next/src/form-layout/index.tsx | 2 +- packages/next/src/form-layout/useResponsiveFormLayout.ts | 4 +--- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/antd/src/form-layout/index.tsx b/packages/antd/src/form-layout/index.tsx index b529a2e8b4f..95c5bc0e668 100644 --- a/packages/antd/src/form-layout/index.tsx +++ b/packages/antd/src/form-layout/index.tsx @@ -1,5 +1,5 @@ import React, { createContext, useContext } from 'react' -import useResponsiveFormLayout from './useResponsiveFormLayout' +import { useResponsiveFormLayout } from './useResponsiveFormLayout' import { usePrefixCls } from '../__builtins__' import cls from 'classnames' diff --git a/packages/antd/src/form-layout/useResponsiveFormLayout.ts b/packages/antd/src/form-layout/useResponsiveFormLayout.ts index 26fc838c760..ffbc8ae2053 100644 --- a/packages/antd/src/form-layout/useResponsiveFormLayout.ts +++ b/packages/antd/src/form-layout/useResponsiveFormLayout.ts @@ -73,7 +73,7 @@ const calculateProps: ICalculateProps = (target, props) => { } } -const useResponsiveFormLayout: IUseResponsiveFormLayout = (props) => { +export const useResponsiveFormLayout: IUseResponsiveFormLayout = (props) => { const ref = useRef(null) const { breakpoints } = props if (!isArr(breakpoints)) { @@ -104,5 +104,3 @@ const useResponsiveFormLayout: IUseResponsiveFormLayout = (props) => { props: layoutProps, } } - -export default useResponsiveFormLayout diff --git a/packages/next/src/form-layout/index.tsx b/packages/next/src/form-layout/index.tsx index 8d1a33cce78..d72adcf39a8 100644 --- a/packages/next/src/form-layout/index.tsx +++ b/packages/next/src/form-layout/index.tsx @@ -1,5 +1,5 @@ import React, { createContext, useContext } from 'react' -import useResponsiveFormLayout from './useResponsiveFormLayout' +import { useResponsiveFormLayout } from './useResponsiveFormLayout' import { usePrefixCls } from '../__builtins__' import cls from 'classnames' diff --git a/packages/next/src/form-layout/useResponsiveFormLayout.ts b/packages/next/src/form-layout/useResponsiveFormLayout.ts index 26fc838c760..ffbc8ae2053 100644 --- a/packages/next/src/form-layout/useResponsiveFormLayout.ts +++ b/packages/next/src/form-layout/useResponsiveFormLayout.ts @@ -73,7 +73,7 @@ const calculateProps: ICalculateProps = (target, props) => { } } -const useResponsiveFormLayout: IUseResponsiveFormLayout = (props) => { +export const useResponsiveFormLayout: IUseResponsiveFormLayout = (props) => { const ref = useRef(null) const { breakpoints } = props if (!isArr(breakpoints)) { @@ -104,5 +104,3 @@ const useResponsiveFormLayout: IUseResponsiveFormLayout = (props) => { props: layoutProps, } } - -export default useResponsiveFormLayout