fix: use undefined (#38046)

* fix: use undefined

* fix: use undefined
This commit is contained in:
lijianan 2022-10-16 11:01:19 +08:00 committed by GitHub
parent f85698f70e
commit 6fc4513017
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -76,7 +76,7 @@ const BackTop: React.FC<BackTopProps> = props => {
const rootPrefixCls = getPrefixCls();
const [wrapSSR] = useStyle(prefixCls);
const groupShape = useContext<FloatButtonShape | null>(FloatButtonGroupContext);
const groupShape = useContext<FloatButtonShape | undefined>(FloatButtonGroupContext);
const mergeShape = groupShape || shape;

View File

@ -1,7 +1,7 @@
import React from 'react';
import type { FloatButtonShape } from './interface';
const FloatButtonGroupContext = React.createContext<FloatButtonShape | null>(null);
const FloatButtonGroupContext = React.createContext<FloatButtonShape | undefined>(undefined);
export const { Provider: FloatButtonGroupProvider } = FloatButtonGroupContext;

View File

@ -33,7 +33,7 @@ const FloatButton: React.ForwardRefRenderFunction<
...restProps
} = props;
const { getPrefixCls, direction } = useContext<ConfigConsumerProps>(ConfigContext);
const groupShape = useContext<FloatButtonShape | null>(FloatButtonGroupContext);
const groupShape = useContext<FloatButtonShape | undefined>(FloatButtonGroupContext);
const prefixCls = getPrefixCls(floatButtonPrefixCls, customizePrefixCls);
const [wrapSSR, hashId] = useStyle(prefixCls);