Fix forwarded ref (#4348)
parent
e7968bc8d7
commit
c352e0f8b4
|
@ -32,14 +32,17 @@ interface AddedProps {
|
||||||
desktopFixedHeight?: boolean | number
|
desktopFixedHeight?: boolean | number
|
||||||
}
|
}
|
||||||
|
|
||||||
export const CenteredView = React.forwardRef(function CenteredView({
|
export const CenteredView = React.forwardRef(function CenteredView(
|
||||||
style,
|
{
|
||||||
sideBorders,
|
style,
|
||||||
topBorder,
|
sideBorders,
|
||||||
...props
|
topBorder,
|
||||||
}: React.PropsWithChildren<
|
...props
|
||||||
ViewProps & {sideBorders?: boolean; topBorder?: boolean}
|
}: React.PropsWithChildren<
|
||||||
>) {
|
ViewProps & {sideBorders?: boolean; topBorder?: boolean}
|
||||||
|
>,
|
||||||
|
ref: React.Ref<View>,
|
||||||
|
) {
|
||||||
const pal = usePalette('default')
|
const pal = usePalette('default')
|
||||||
const {isMobile} = useWebMediaQueries()
|
const {isMobile} = useWebMediaQueries()
|
||||||
if (!isMobile) {
|
if (!isMobile) {
|
||||||
|
@ -58,7 +61,7 @@ export const CenteredView = React.forwardRef(function CenteredView({
|
||||||
})
|
})
|
||||||
style = addStyle(style, pal.border)
|
style = addStyle(style, pal.border)
|
||||||
}
|
}
|
||||||
return <View style={style} {...props} />
|
return <View ref={ref} style={style} {...props} />
|
||||||
})
|
})
|
||||||
|
|
||||||
export const FlatList_INTERNAL = React.forwardRef(function FlatListImpl<ItemT>(
|
export const FlatList_INTERNAL = React.forwardRef(function FlatListImpl<ItemT>(
|
||||||
|
|
Loading…
Reference in New Issue