Browse Source

fix: use undefined (#38046)

* fix: use undefined

* fix: use undefined
pull/38057/head
lijianan 2 years ago
committed by GitHub
parent
commit
6fc4513017
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      components/float-button/BackTop.tsx
  2. 2
      components/float-button/context.ts
  3. 2
      components/float-button/index.tsx

2
components/float-button/BackTop.tsx

@ -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;

2
components/float-button/context.ts

@ -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;

2
components/float-button/index.tsx

@ -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);

Loading…
Cancel
Save