import type { CSSProperties, ReactNode } from 'react' import { View, Text } from '@tarojs/components' const isH5 = process.env.TARO_ENV === 'h5' type BoxProps = { className?: string id?: string children?: ReactNode onClick?: () => void html?: string style?: CSSProperties 'aria-hidden'?: boolean 'aria-label'?: string 'data-theme'?: string } /** H5 uses native div (taro-view-core defaults to inline and breaks grid/absolute). */ export function H5Box({ className, id, children, onClick, html, style, 'aria-hidden': ariaHidden, 'aria-label': ariaLabel, 'data-theme': dataTheme, }: BoxProps) { if (isH5) { return (
{html ? undefined : children}
) } return ( {html ? undefined : children} ) } export function H5Txt({ className, id, children, }: { className?: string id?: string children?: ReactNode }) { if (isH5) return {children} return ( {children} ) }