refactor(mobile): simplify TabBarRootWrapper props and update type definitions
This commit is contained in:
parent
07452b5e70
commit
6b6b7e2a8c
|
|
@ -1,13 +1,10 @@
|
|||
import { requireNativeView } from "expo"
|
||||
import type { NativeSyntheticEvent, ViewProps } from "react-native"
|
||||
import type { ViewProps } from "react-native"
|
||||
|
||||
import type { TabBarRootWrapperProps } from "./types"
|
||||
|
||||
export const TabBarPortalWrapper = requireNativeView<ViewProps>("TabBarPortal")
|
||||
|
||||
export const TabScreenWrapper = requireNativeView<ViewProps>("TabScreen")
|
||||
|
||||
export const TabBarRootWrapper = requireNativeView<
|
||||
{
|
||||
onTabIndexChange: (e: NativeSyntheticEvent<{ index: number }>) => void
|
||||
selectedIndex: number
|
||||
} & ViewProps
|
||||
>("TabBarRoot")
|
||||
export const TabBarRootWrapper = requireNativeView<TabBarRootWrapperProps>("TabBarRoot")
|
||||
|
|
|
|||
|
|
@ -1,13 +1,10 @@
|
|||
import { requireNativeView } from "expo"
|
||||
import type { NativeSyntheticEvent, ViewProps } from "react-native"
|
||||
import type { ViewProps } from "react-native"
|
||||
|
||||
import type { TabBarRootWrapperProps } from "./types"
|
||||
|
||||
export const TabBarPortalWrapper = requireNativeView<ViewProps>("TabBarPortal")
|
||||
|
||||
export const TabScreenWrapper = requireNativeView<ViewProps>("TabScreen")
|
||||
|
||||
export const TabBarRootWrapper = requireNativeView<
|
||||
{
|
||||
onTabIndexChange: (e: NativeSyntheticEvent<{ index: number }>) => void
|
||||
selectedIndex: number
|
||||
} & ViewProps
|
||||
>("TabBarRoot")
|
||||
export const TabBarRootWrapper = requireNativeView<TabBarRootWrapperProps>("TabBarRoot")
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
import type { NativeSyntheticEvent, ViewProps } from "react-native"
|
||||
import { View } from "react-native"
|
||||
|
||||
import type { TabBarRootWrapperProps } from "./types"
|
||||
|
||||
export { View as TabBarPortalWrapper } from "react-native"
|
||||
export { View as TabScreenWrapper } from "react-native"
|
||||
|
||||
export const TabBarRootWrapper = (
|
||||
props: {
|
||||
onTabIndexChange: (e: NativeSyntheticEvent<{ index: number }>) => void
|
||||
selectedIndex: number
|
||||
} & ViewProps,
|
||||
) => {
|
||||
export const TabBarRootWrapper = (props: TabBarRootWrapperProps) => {
|
||||
return <View {...props} />
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import type { FC } from "react"
|
||||
import type { NativeSyntheticEvent, ViewProps } from "react-native"
|
||||
|
||||
export type TabbarIconProps = {
|
||||
focused: boolean
|
||||
|
|
@ -18,3 +19,8 @@ export interface TabScreenProps {
|
|||
lazy?: boolean
|
||||
identifier?: string
|
||||
}
|
||||
|
||||
export type TabBarRootWrapperProps = {
|
||||
onTabIndexChange: (e: NativeSyntheticEvent<{ index: number }>) => void
|
||||
selectedIndex: number
|
||||
} & ViewProps
|
||||
|
|
|
|||
Loading…
Reference in New Issue