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

Function StyledText

src/components/Typography/v2/StyledText.tsx:17–48  ·  view source on GitHub ↗
({
  alpha = 1,
  family,
  style,
  theme: themeOverrides,
  ...rest
}: Props)

Source from the content-addressed store, hash-verified

15};
16
17const StyledText = ({
18 alpha = 1,
19 family,
20 style,
21 theme: themeOverrides,
22 ...rest
23}: Props) => {
24 const theme = useInternalTheme(themeOverrides);
25
26 const textColor = color(
27 theme.isV3 ? theme.colors.onSurface : theme.colors?.text
28 )
29 .alpha(alpha)
30 .rgb()
31 .string();
32 const writingDirection = I18nManager.getConstants().isRTL ? 'rtl' : 'ltr';
33
34 return (
35 <Text
36 {...rest}
37 style={[
38 styles.text,
39 {
40 color: textColor,
41 ...(!theme.isV3 && theme.fonts?.[family]),
42 writingDirection,
43 },
44 style,
45 ]}
46 />
47 );
48};
49
50const styles = StyleSheet.create({
51 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…