Browse Source
fix: use undefined (#38046)
* fix: use undefined
* fix: use undefined
pull/38057/head
lijianan
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
3 additions and
3 deletions
-
components/float-button/BackTop.tsx
-
components/float-button/context.ts
-
components/float-button/index.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; |
|
|
|
|
|
|
|
|
|
@ -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; |
|
|
|
|
|
|
|
|
|
@ -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); |
|
|
|
|
|
|
|