Files
jrshikoku/utils/disableFontScaling.ts
2025-12-05 08:32:48 +00:00

19 lines
663 B
TypeScript

/**
* グローバルなフォントスケーリング設定
* Text.defaultProps の非推奨対応
*
* このファイルを App.tsx の最初でインポートすることで、
* アプリ全体の Text コンポーネントで allowFontScaling={false} が適用されます
*/
import { Text } from "react-native";
// Text.defaultProps は非推奨ですが、既存コードとの互換性のため一時的に使用
// @ts-ignore - defaultProps は非推奨だが、現在のReact Nativeバージョンでは動作する
if (!Text.defaultProps) {
// @ts-ignore
Text.defaultProps = {};
}
// @ts-ignore
Text.defaultProps.allowFontScaling = false;