import { PropsWithChildren } from 'react';
export type BaseFragmentProps = PropsWithChildren<{
isShow?: boolean;
}>;
export const BaseFragment = (props: BaseFragmentProps) => {
const { isShow = true, children } = props;
if (!isShow) {
return null;
}
return <>{children}</>;
};
my code:
src/components/BaseView/index.tsxatlas output: