Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/wojtekmaj/react-t. Simple translation module for React applications.
Something went wrong. Try again.
TSX
123456789101112131415161718192021import React from 'react';import PropTypes from 'prop-types';
import useTranslation from './useTranslation';
import type { Args } from './shared/types';
export type TProps = { children?: string;} & Args;
export default function T({ children, ...args }: TProps) { const translatedChildren = useTranslation(children, args);
return translatedChildren === undefined ? null : <>{translatedChildren}</>;}
T.propTypes = { children: PropTypes.string,};