react-native#TextProps TypeScript Examples

The following examples show how to use react-native#TextProps. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ErrorText.tsx    From vsinder with Apache License 2.0 6 votes vote down vote up
ErrorText: React.FC<TextProps> = ({
  children,
  style,
  ...props
}) => {
  const [{ inputValidationErrorBorder }] = useContext(ThemeContext);
  return (
    <Text {...props} style={[style, { color: inputValidationErrorBorder }]}>
      {children}
    </Text>
  );
}
Example #2
Source File: MyHeader.tsx    From vsinder with Apache License 2.0 6 votes vote down vote up
MyHeader: React.FC<TextProps> = ({
  children,
  style,
  ...props
}) => {
  return (
    <MyText {...props} style={[style, { fontSize: 20 }]}>
      {children}
    </MyText>
  );
}
Example #3
Source File: LocalizedText.tsx    From react-native-typescript-starter with MIT License 6 votes vote down vote up
LocalizedText : FC<TextProps> = props => {
    const { style, children, ...rest } = props;
    const { translate } = useLocalization();

    return (
        <Text style={style} {...rest}>
            {Children.map(children, child => {
                if (typeof child === 'string') {
                    return translate(child);
                }

                return child;
            })}
        </Text>
    );
}
Example #4
Source File: Link.d.ts    From nlw2-proffy with MIT License 6 votes vote down vote up
/**
 * Component to render link to another screen using a path.
 * Uses an anchor tag on the web.
 *
 * @param props.to Absolute path to screen (e.g. `/feeds/hot`).
 * @param props.action Optional action to use for in-page navigation. By default, the path is parsed to an action based on linking config.
 * @param props.children Child elements to render the content.
 */
export default function Link({ to, action, ...rest }: Props): React.CElement<TextProps, Text>;
Example #5
Source File: MyText.tsx    From vsinder with Apache License 2.0 5 votes vote down vote up
MyText: React.FC<TextProps> = ({ children, style, ...props }) => {
  const [{ editorForeground }] = useContext(ThemeContext);
  return (
    <Text {...props} style={[style, { color: editorForeground }]}>
      {children}
    </Text>
  );
}
Example #6
Source File: Text.tsx    From react-native-jigsaw with MIT License 5 votes vote down vote up
setNativeProps(args: TextProps) {
    return this._root && this._root.setNativeProps(args);
  }
Example #7
Source File: Typography.tsx    From jellyfin-audio-player with MIT License 5 votes vote down vote up
export function Text(props: PropsWithChildren<TextProps>) {
    const defaultStyles = useDefaultStyles();

    return (
        <BaseText {...props} style={[defaultStyles.text, props.style]} />
    );
}
Example #8
Source File: TextSelectable.tsx    From wuhan2020-frontend-react-native-app with MIT License 5 votes vote down vote up
function TextSelectable(props: TextProps) {
  return <Text {...props} selectable />;
}