import * as React from 'react'; import { Text as NativeText, TextStyle, StyleProp, StyleSheet, } from 'react-native'; import { withTheme } from '../../core/theming'; type Props = React.ComponentProps & { style?: StyleProp; /** * @optional */ theme: ReactNativePaper.Theme; }; // @component-group Typography /** * Text component which follows styles from the theme. * * @extends Text props https://reactnative.dev/docs/text#props */ const Text: React.RefForwardingComponent<{}, Props> = ( { style, theme, ...rest }: Props, ref ) => { const root = React.useRef(null); React.useImperativeHandle(ref, () => ({ setNativeProps: (args: Object) => root.current?.setNativeProps(args), })); return ( ); }; const styles = StyleSheet.create({ text: { textAlign: 'left', }, }); export default withTheme(React.forwardRef(Text));