11import React from 'react'
2+ import { View , ViewProps } from 'react-native'
23
34import { useBreakpoint } from '../context'
45import { isCurrentBreakpointBelow , isCurrentBreakpointAbove , Breakpoint } from '../utils'
@@ -7,10 +8,11 @@ export interface Props {
78 children : React . ReactNode
89 below ?: Exclude < Breakpoint , 'mobile' >
910 above ?: Exclude < Breakpoint , 'desktop' >
11+ style ?: ViewProps [ 'style' ]
1012}
1113
12- export const Hidden = ( props : Props ) : JSX . Element | null => {
13- const { children, below, above } = props
14+ export const Hidden = ( props : Props ) => {
15+ const { children, below, above, style } = props
1416 const { currentBreakpoint } = useBreakpoint ( )
1517
1618 if ( typeof below === 'undefined' && typeof above === 'undefined' ) {
@@ -19,6 +21,6 @@ export const Hidden = (props: Props): JSX.Element | null => {
1921
2022 return isCurrentBreakpointBelow ( currentBreakpoint , below ) ||
2123 isCurrentBreakpointAbove ( currentBreakpoint , above ) ? null : (
22- < > { children } </ >
24+ < View style = { style } > { children } </ View >
2325 )
2426}
0 commit comments