作成:2026-01-21最終更新:2026-01-21

    react-native-intlayer パッケージ

    react-native-intlayer パッケージは、Intlayer を React Native アプリケーションに統合するために必要なツールを提供します。プロバイダーとロケールサポートのためのポリフィルが含まれています。

    インストール

    npm install react-native-intlayer

    エクスポート

    プロバイダー

    コンポーネント 説明
    IntlayerProvider アプリケーションをラップし、Intlayer コンテキストを提供するプロバイダーコンポーネント。

    インポート:

    import "react-native-intlayer";

    ポリフィル

    関数 説明
    intlayerPolyfill React Native が Intlayer をサポートするために必要なポリフィルを適用する関数。

    インポート:

    import "react-native-intlayer";

    Metro の設定

    react-native-intlayer パッケージは、Intlayer が React Native 上で正しく動作するようにするための Metro 設定ユーティリティを提供します。

    関数 説明
    configMetroIntlayer Intlayer を準備し、Metro 設定をマージする非同期関数。
    configMetroIntlayerSync Intlayer のリソースを準備せずに Metro 設定をマージする同期関数。
    exclusionList バンドルからコンテンツファイルを除外するために、Metro の blockList 用の RegExp パターンを作成します。

    インポート:

    import "react-native-intlayer/metro";
    import "react-native-intlayer/metro";