MCPcopy Create free account
hub / github.com/callstack/react-native-paper / Text

Function Text

src/components/Typography/v2/Text.tsx:29–54  ·  view source on GitHub ↗
(
  { style, theme: overrideTheme, ...rest }: Props,
  ref
)

Source from the content-addressed store, hash-verified

27 * @extends Text props https://reactnative.dev/docs/text#props
28 */
29const Text: React.ForwardRefRenderFunction<{}, Props> = (
30 { style, theme: overrideTheme, ...rest }: Props,
31 ref
32) => {
33 const root = React.useRef<NativeText | null>(null);
34 const theme = useInternalTheme(overrideTheme);
35
36 React.useImperativeHandle(ref, () => ({
37 setNativeProps: (args: Object) => root.current?.setNativeProps(args),
38 }));
39
40 return (
41 <NativeText
42 {...rest}
43 ref={root}
44 style={[
45 {
46 ...(!theme.isV3 && theme.fonts?.regular),
47 color: theme.isV3 ? theme.colors?.onSurface : theme.colors.text,
48 },
49 styles.text,
50 style,
51 ]}
52 />
53 );
54};
55
56const styles = StyleSheet.create({
57 text: {

Callers

nothing calls this directly

Calls 1

useInternalThemeFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…