import React, { useRef, memo } from 'react'; import { StyleSheet, ViewStyle } from 'react-native'; import { View } from 'react-native'; import type { TabViewProps } from './interface'; const activeStyle: ViewStyle = {}; const inactiveStyle: ViewStyle = { display: 'none' }; const TabView: React.FC = ({ children, active, lazyRender = true, swipe, tabWidth, onLayout, }) => { const Activated = useRef(!lazyRender); if (active) { Activated.current = true; } return ( <> {swipe ? ( {children} ) : ( {Activated.current ? children : null} )} ); }; export default memo(TabView);