17 lines
635 B
TypeScript
17 lines
635 B
TypeScript
import React from "react";
|
|
import { Text as RNText, TextProps } from "react-native";
|
|
|
|
/**
|
|
* フォントスケーリングを無効化したカスタムTextコンポーネント
|
|
* Text.defaultPropsの代替として使用
|
|
*
|
|
* 使用方法:
|
|
* import { Text } from '@/components/atom/CustomText';
|
|
* の代わりに react-native から Text をインポートする場合は
|
|
* 自動的に allowFontScaling={false} が適用されます
|
|
*/
|
|
export const Text: React.FC<TextProps> = (props) => {
|
|
const { allowFontScaling = false, ...restProps } = props;
|
|
return <RNText {...restProps} allowFontScaling={allowFontScaling} />;
|
|
};
|