日本語版
最新ニュース
科学&テクノロジー

反応 v19 – 反応

警告: テキストの内容が一致しませんでした。サーバー:「サーバー」 クライアント:「クライアント」 スパンで アプリで警告: ハイドレーション中にエラーが発生しました。サーバーの HTML がクライアントのコンテンツに置き換えられました。 。警告: テキストの内容が一致しませんでした。サーバー:「サーバー」 クライアント:「クライアント」 スパンで アプリで警告: ハイドレーション中にエラーが発生しました。サーバーの HTML がクライアントのコンテンツに置き換えられました。 。キャッチされないエラー: テキスト コンテンツがサーバーでレンダリングされた HTML と一致しません。 checkForUnmatchedText で … ここで、不一致の差分を含む 1 つのメッセージをログに記録します。 キャッチされないエラー: サーバーでレンダリングされた HTML がクライアントと一致しないため、ハイドレーションが失敗しました。その結果、このツリーはクライアント上で再生成されます。これは、SSR 化されたクライアント コンポーネントが以下を使用した場合に発生する可能性があります。 - サーバー/クライアント ブランチ if (typeof…

反応 v19 – 反応

1733778862
2024-12-09 09:34:00

警告: テキストの内容が一致しませんでした。サーバー:「サーバー」 クライアント:「クライアント」
スパンで
アプリで

警告: ハイドレーション中にエラーが発生しました。サーバーの HTML がクライアントのコンテンツに置き換えられました。

警告: テキストの内容が一致しませんでした。サーバー:「サーバー」 クライアント:「クライアント」
スパンで
アプリで

警告: ハイドレーション中にエラーが発生しました。サーバーの HTML がクライアントのコンテンツに置き換えられました。

キャッチされないエラー: テキスト コンテンツがサーバーでレンダリングされた HTML と一致しません。
checkForUnmatchedText で

ここで、不一致の差分を含む 1 つのメッセージをログに記録します。

キャッチされないエラー: サーバーでレンダリングされた HTML がクライアントと一致しないため、ハイドレーションが失敗しました。その結果、このツリーはクライアント上で再生成されます。これは、SSR 化されたクライアント コンポーネントが以下を使用した場合に発生する可能性があります。

– サーバー/クライアント ブランチ if (typeof window !== 'undefined')。 – などの変数入力 Date.now() または Math.random() 呼び出されるたびに変化します。 – ユーザーのロケールでの日付の形式がサーバーと一致しません。 – HTML とともにスナップショットを送信しない外部変更データ。 – HTML タグのネストが無効です。

また、クライアントにブラウザ拡張機能がインストールされており、React がロードされる前に HTML が混乱する場合にも発生する可能性があります。

https://react.dev/link/水和-mismatch



+ クライアント
サーバ

スロー時水分補給の不一致

プロバイダーとして

React 19 では、レンダリングできます。 の代わりにプロバイダーとして :

const ThemeContext = createContext('');

function App({children}) {

return (

ThemeContext value="dark">

{children}

ThemeContext>

);

}

新しいコンテキストプロバイダーが使用できる また、既存のプロバイダーを変換する codemod を公開する予定です。将来のバージョンでは非推奨になります

参照のクリーンアップ関数

からのクリーンアップ関数を返すことをサポートするようになりました。 ref コールバック:

input

ref={(ref) => {

return () => {

};

}}

/>

コンポーネントがアンマウントされると、React はコンポーネントから返されたクリーンアップ関数を呼び出します。 ref 折り返し電話。これは、DOM 参照、クラス コンポーネントへの参照、および useImperativeHandle

注記

以前は、React は ref を備えた関数 null コンポーネントをアンマウントするとき。もしあなたの ref クリーンアップ関数を返すと、React はこのステップをスキップします。

将来のバージョンでは、 refs の呼び出しは非推奨になります。 null コンポーネントをアンマウントするとき。

ref クリーンアップ関数の導入により、 ref コールバックは TypeScript によって拒否されるようになります。修正は通常、暗黙的な戻り値の使用を停止することです。次に例を示します。

- div ref={current => (instance = current)} />

+ div ref={current => {instance = current}} />

元のコードは、 HTMLDivElement TypeScript はこれがそうなのかどうかを知りません。 想定 クリーンアップ関数にするか、クリーンアップ関数を返したくない場合。

このパターンをコードモッドすることができます no-implicit-ref-callback-return

useDeferredValue 初期値

を追加しました initialValue というオプション useDeferredValue:

function Search({deferredValue}) {

const value = useDeferredValue(deferredValue, '');

return (

Results query={value} />

);

}

いつ 初期値 提供されており、 useDeferredValue として返します value コンポーネントの最初のレンダリングに使用し、バックグラウンドでの再レンダリングをスケジュールします。 遅延値 戻ってきました。

詳細については、を参照してください。 useDeferredValue

ドキュメントメタデータのサポート

HTML では、次のようなドキュメントのメタデータ タグが使用されます。 </code>、 <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><link/></code>、 そして <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><meta/></code> に配置するために予約されています。 <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/> section of the document. In React, the component that decides what metadata is appropriate for the app may be very far from the place where you render the <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/> or React does not render the <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/> at all. In the past, these elements would need to be inserted manually in an effect, or by libraries like <a target="_blank" href="https://github.com/nfl/react-helmet" rel="nofollow noopener noreferrer" class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px">react-helmet</code></a>、サーバーが React アプリケーションをレンダリングするときは慎重な取り扱いが必要でした。</p><div class="yqifi6a6fd6ac42724" > <ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-0928966750491324" data-ad-slot="4752185579"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div><style type="text/css"> @media screen and (min-width: 1201px) { .yqifi6a6fd6ac42724 { display: block; } } @media screen and (min-width: 993px) and (max-width: 1200px) { .yqifi6a6fd6ac42724 { display: block; } } @media screen and (min-width: 769px) and (max-width: 992px) { .yqifi6a6fd6ac42724 { display: block; } } @media screen and (min-width: 768px) and (max-width: 768px) { .yqifi6a6fd6ac42724 { display: block; } } @media screen and (max-width: 767px) { .yqifi6a6fd6ac42724 { display: block; } } </style> <p class="whitespace-pre-wrap my-4">React 19 では、コンポーネント内のドキュメント メタデータ タグをネイティブにレンダリングするためのサポートを追加しています。</p> <p><!--$--></p> <div dir="ltr" class="sandpack sandpack--codeblock rounded-2xl h-full w-full overflow-x-auto flex items-center bg-wash dark:bg-gray-95 shadow-lg my-8" style="contain:content"> <div class="sp-wrapper"> <div class="sp-stack"> <div class="sp-code-editor"> <pre class="sp-cm sp-pristine sp-javascript flex align-start"><code class="sp-pre-placeholder grow-[2]"><p><span class="sp-syntax-keyword">function</span> <span class="sp-syntax-definition">BlogPost</span><span class="sp-syntax-punctuation">(</span><span class="sp-syntax-punctuation">{</span><span class="sp-syntax-property">post</span><span class="sp-syntax-punctuation">}</span><span class="sp-syntax-punctuation">)</span> <span class="sp-syntax-punctuation">{</span><br/></p><p> <span class="sp-syntax-keyword">return</span> <span class="sp-syntax-punctuation">(</span><br/></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">article</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">h1</span><span class="sp-syntax-punctuation">></span><span class="sp-syntax-punctuation">{</span><span class="sp-syntax-plain">post</span>.<span class="sp-syntax-property">title</span><span class="sp-syntax-punctuation">}</span><span class="sp-syntax-punctuation"/><span class="sp-syntax-tag">h1</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">title</span><span class="sp-syntax-punctuation">></span><span class="sp-syntax-punctuation">{</span><span class="sp-syntax-plain">post</span>.<span class="sp-syntax-property">title</span><span class="sp-syntax-punctuation">}</span><span class="sp-syntax-punctuation"/><span class="sp-syntax-tag">title</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">meta</span> <span class="sp-syntax-property">name</span>=<span class="sp-syntax-string">"author"</span> <span class="sp-syntax-property">content</span>=<span class="sp-syntax-string">"Josh"</span> <span class="sp-syntax-punctuation">/></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">link</span> <span class="sp-syntax-property">rel</span>=<span class="sp-syntax-string">"author"</span> <span class="sp-syntax-property">href</span>=<span class="sp-syntax-string">"https://twitter.com/joshcstory/"</span> <span class="sp-syntax-punctuation">/></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">meta</span> <span class="sp-syntax-property">name</span>=<span class="sp-syntax-string">"keywords"</span> <span class="sp-syntax-property">content</span>=<span class="sp-syntax-punctuation">{</span><span class="sp-syntax-plain">post</span>.<span class="sp-syntax-property">keywords</span><span class="sp-syntax-punctuation">}</span> <span class="sp-syntax-punctuation">/></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">p</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> Eee equals em-see-squared...<br/></p><p> <span class="sp-syntax-punctuation"/><span class="sp-syntax-tag">p</span><span class="sp-syntax-punctuation">></span><br/></p><p> <span class="sp-syntax-punctuation"/><span class="sp-syntax-tag">article</span><span class="sp-syntax-punctuation">></span><br/></p><p> <span class="sp-syntax-punctuation">)</span><span class="sp-syntax-punctuation">;</span><br/></p><p><span class="sp-syntax-punctuation">}</span></p></code></pre> </div> </div> </div> </div> <p><!--/$--></p> <p class="whitespace-pre-wrap my-4">React がこのコンポーネントをレンダリングすると、 <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><title/></code> <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><link/></code> そして <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><meta/></code> タグを取得し、それらを自動的にホイストします。 <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/> section of document. By supporting these metadata tags natively, we’re able to ensure they work with client-only apps, streaming SSR, and Server Components.</p> <div class="expandable-callout pt-8 pb-4 px-5 sm:px-8 my-8 relative rounded-none shadow-inner-border -mx-5 sm:mx-auto sm:rounded-2xl bg-green-5 dark:bg-green-60 dark:bg-opacity-20 text-primary dark:text-primary-dark text-lg"> <h3 class="text-2xl font-display font-bold text-green-60 dark:text-green-40"><svg xmlns="http://www.w3.org/2000/svg" class="inline me-2 mb-1 text-lg text-green-60 dark:text-green-40" width="2em" height="2em" viewbox="0 0 72 72" fill="none"><g clip-path="url(#clip0_40_48064)"><path d="M24 27C24 25.3431 25.3431 24 27 24H45C46.6569 24 48 25.3431 48 27C48 28.6569 46.6569 30 45 30H27C25.3431 30 24 28.6569 24 27Z" fill="currentColor"/><path d="M24 39C24 37.3431 25.3431 36 27 36H39C40.6569 36 42 37.3431 42 39C42 40.6569 40.6569 42 39 42H27C25.3431 42 24 40.6569 24 39Z" fill="currentColor"/><path fill-rule="evenodd" clip-rule="evenodd" d="M12 18C12 13.0294 16.0294 9 21 9H51C55.9706 9 60 13.0294 60 18V54C60 58.9706 55.9706 63 51 63H21C16.0294 63 12 58.9706 12 54V18ZM21 15H51C52.6569 15 54 16.3431 54 18V54C54 55.6569 52.6569 57 51 57H21C19.3431 57 18 55.6569 18 54V18C18 16.3431 19.3431 15 21 15Z" fill="currentColor"/></g><defs><clippath id="clip0_40_48064"><rect width="72" height="72" fill="white"/></clippath></defs></svg>Note</h3> <div class="relative"> <div class="py-2"> <h4 id="you-may-still-want-a-metadata-library" class="mdx-heading text-xl font-display font-bold leading-9 my-4">You may still want a Metadata library </h4> <p class="whitespace-pre-wrap my-4">For simple use cases, rendering Document Metadata as tags may be suitable, but libraries can offer more powerful features like overriding generic metadata with specific metadata based on the current route. These features make it easier for frameworks and libraries like <a target="_blank" href="https://github.com/nfl/react-helmet" rel="nofollow noopener noreferrer" class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px">react-helmet</code></a> メタデータ タグを置き換えるのではなく、サポートするためです。</p> </div> </div> </div> <p class="whitespace-pre-wrap my-4">詳細については、ドキュメントを参照してください。 <a target="_blank" class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal" href="https://react.dev/reference/react-dom/components/title" rel="noopener"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><title/></code></a>、 <a target="_blank" class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal" href="https://react.dev/reference/react-dom/components/link" rel="noopener"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><link/></code></a>、 そして <a target="_blank" class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal" href="https://react.dev/reference/react-dom/components/meta" rel="noopener"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><meta/></code></a>。</p> <h3 id="support-for-stylesheets" class="mdx-heading text-2xl font-display leading-9 text-primary dark:text-primary-dark font-bold my-6">スタイルシートのサポート </h3> <p class="whitespace-pre-wrap my-4">スタイルシート、両方とも外部リンク (<code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><link rel=""stylesheet"" href=""...""/></code>) およびインライン (<code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/>), require careful positioning in the DOM due to style precedence rules. Building a stylesheet capability that allows for composability within components is hard, so users often end up either loading all of their styles far from the components that may depend on them, or they use a style library which encapsulates this complexity.</p> <p class="whitespace-pre-wrap my-4">In React 19, we’re addressing this complexity and providing even deeper integration into Concurrent Rendering on the Client and Streaming Rendering on the Server with built in support for stylesheets. If you tell React the <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px">precedence</code> スタイルシートの DOM 内でのスタイルシートの挿入順序を管理し、スタイル ルールに依存するコンテンツを表示する前にスタイルシート (外部の場合) が読み込まれるようにします。</p> <p><!--$--></p> <div dir="ltr" class="sandpack sandpack--codeblock rounded-2xl h-full w-full overflow-x-auto flex items-center bg-wash dark:bg-gray-95 shadow-lg my-8" style="contain:content"> <div class="sp-wrapper"> <div class="sp-stack"> <div class="sp-code-editor"> <pre class="sp-cm sp-pristine sp-javascript flex align-start"><code class="sp-pre-placeholder grow-[2]"><p><span class="sp-syntax-keyword">function</span> <span class="sp-syntax-definition">ComponentOne</span><span class="sp-syntax-punctuation">(</span><span class="sp-syntax-punctuation">)</span> <span class="sp-syntax-punctuation">{</span><br/></p><p> <span class="sp-syntax-keyword">return</span> <span class="sp-syntax-punctuation">(</span><br/></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-definition">Suspense</span> <span class="sp-syntax-property">fallback</span>=<span class="sp-syntax-string">"loading..."</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">link</span> <span class="sp-syntax-property">rel</span>=<span class="sp-syntax-string">"stylesheet"</span> <span class="sp-syntax-property">href</span>=<span class="sp-syntax-string">"foo"</span> <span class="sp-syntax-property">precedence</span>=<span class="sp-syntax-string">"default"</span> <span class="sp-syntax-punctuation">/></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">link</span> <span class="sp-syntax-property">rel</span>=<span class="sp-syntax-string">"stylesheet"</span> <span class="sp-syntax-property">href</span>=<span class="sp-syntax-string">"bar"</span> <span class="sp-syntax-property">precedence</span>=<span class="sp-syntax-string">"high"</span> <span class="sp-syntax-punctuation">/></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">article</span> <span class="sp-syntax-property">class</span>=<span class="sp-syntax-string">"foo-class bar-class"</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation">{</span><span class="sp-syntax-punctuation">...</span>}<br/></p><p> <span class="sp-syntax-punctuation"/><span class="sp-syntax-tag">article</span><span class="sp-syntax-punctuation">></span><br/></p><p> <span class="sp-syntax-punctuation"/><span class="sp-syntax-definition">Suspense</span><span class="sp-syntax-punctuation">></span><br/></p><p> <span class="sp-syntax-punctuation">)</span><br/></p><p><span class="sp-syntax-punctuation">}</span><br/></p><p><span class="sp-syntax-keyword">function</span> <span class="sp-syntax-definition">ComponentTwo</span><span class="sp-syntax-punctuation">(</span><span class="sp-syntax-punctuation">)</span> <span class="sp-syntax-punctuation">{</span><br/></p><p> <span class="sp-syntax-keyword">return</span> <span class="sp-syntax-punctuation">(</span><br/></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">div</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">p</span><span class="sp-syntax-punctuation">></span><span class="sp-syntax-punctuation">{</span><span class="sp-syntax-punctuation">...</span>}<span class="sp-syntax-punctuation"/><span class="sp-syntax-tag">p</span><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-tag">link</span> <span class="sp-syntax-property">rel</span>=<span class="sp-syntax-string">"stylesheet"</span> <span class="sp-syntax-property">href</span>=<span class="sp-syntax-string">"baz"</span> <span class="sp-syntax-property">precedence</span>=<span class="sp-syntax-string">"default"</span> <span class="sp-syntax-punctuation">/></span> <span class="sp-syntax-punctuation">-- will be inserted between foo & bar<br/></span></span></p><p> <span class="sp-syntax-punctuation"/><span class="sp-syntax-tag">div</span><span class="sp-syntax-punctuation">></span><br/></p><p> )<br/></p><p>}</p></code></pre> </div> </div> </div> </div> <p><!--/$--></p> <p class="whitespace-pre-wrap my-4">サーバー側のレンダリング中に、React はスタイルシートを <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/>, which ensures that the browser will not paint until it has loaded. If the stylesheet is discovered late after we’ve already started streaming, React will ensure that the stylesheet is inserted into the <code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/> on the client before revealing the content of a Suspense boundary that depends on that stylesheet.</p> <p class="whitespace-pre-wrap my-4">During Client Side Rendering React will wait for newly rendered stylesheets to load before committing the render. If you render this component from multiple places within your application React will only include the stylesheet once in the document:</p> <p><!--$--></p> <div dir="ltr" class="sandpack sandpack--codeblock rounded-2xl h-full w-full overflow-x-auto flex items-center bg-wash dark:bg-gray-95 shadow-lg my-8" style="contain:content"> <div class="sp-wrapper"> <div class="sp-stack"> <div class="sp-code-editor"> <pre class="sp-cm sp-pristine sp-javascript flex align-start"><code class="sp-pre-placeholder grow-[2]"><p><span class="sp-syntax-keyword">function</span> <span class="sp-syntax-definition">App</span><span class="sp-syntax-punctuation">(</span><span class="sp-syntax-punctuation">)</span> <span class="sp-syntax-punctuation">{</span><br/></p><p> <span class="sp-syntax-keyword">return</span> <span class="sp-syntax-punctuation"><span class="sp-syntax-punctuation">></span><br/></span></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-definition">ComponentOne</span> <span class="sp-syntax-punctuation">/></span><br/></span></p><p> ...<br/></p><p> <span class="sp-syntax-punctuation"><span class="sp-syntax-definition">ComponentOne</span> <span class="sp-syntax-punctuation">/></span> // won't lead to a duplicate stylesheet link in the DOM<br/></span></p><p> <span class="sp-syntax-punctuation"/><span class="sp-syntax-punctuation">></span><br/></p><p><span class="sp-syntax-punctuation">}</span></p></code></pre> </div> </div> </div> </div> <p><!--/$--></p> <p class="whitespace-pre-wrap my-4">スタイルシートを手動でロードすることに慣れているユーザーにとって、これは、スタイルシートに依存するコンポーネントと並んでスタイルシートを見つける機会となり、より適切なローカル推論が可能になり、実際に依存するスタイルシートのみをロードすることが容易になります。</p> <p class="whitespace-pre-wrap my-4">スタイル ライブラリおよびバンドラーとのスタイル統合でもこの新しい機能を採用できるため、独自のスタイルシートを直接レンダリングしなくても、この機能を使用するようにツールがアップグレードされるため、メリットを得ることができます。</p> <p class="whitespace-pre-wrap my-4">詳細については、ドキュメントを参照してください。 <a target="_blank" class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal" href="https://react.dev/reference/react-dom/components/link" rel="noopener"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><link/></code></a> そして <a target="_blank" class="inline text-link dark:text-link-dark border-b border-link border-opacity-0 hover:border-opacity-100 duration-100 ease-in transition leading-normal" href="https://react.dev/reference/react-dom/components/style" rel="noopener"><code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"/></a>。</p> <h3 id="support-for-async-scripts" class="mdx-heading text-2xl font-display leading-9 text-primary dark:text-primary-dark font-bold my-6">非同期スクリプトのサポート </h3> <p class="whitespace-pre-wrap my-4">HTML の通常のスクリプト (<code dir="ltr" class="inline text-code text-secondary dark:text-secondary-dark px-1 rounded-md no-underline bg-gray-30 bg-opacity-10 py-px"><script async src="https://platform.twitter.com/widgets.js" charset="utf-8"></script><br /> #反応 #v19 #反応</p><div class="xqoez6a6fd6ac42766" > <ins class="adsbygoogle" style="display:block; text-align:center;" data-ad-layout="in-article" data-ad-format="fluid" data-ad-client="ca-pub-0928966750491324" data-ad-slot="4752185579"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script></div><style type="text/css"> @media screen and (min-width: 1201px) { .xqoez6a6fd6ac42766 { display: block; } } @media screen and (min-width: 993px) and (max-width: 1200px) { .xqoez6a6fd6ac42766 { display: block; } } @media screen and (min-width: 769px) and (max-width: 992px) { .xqoez6a6fd6ac42766 { display: block; } } @media screen and (min-width: 768px) and (max-width: 768px) { .xqoez6a6fd6ac42766 { display: block; } } @media screen and (max-width: 767px) { .xqoez6a6fd6ac42766 { display: block; } } </style> <div class="sharedaddy sd-sharing-enabled"><div class="robots-nocontent sd-block sd-social sd-social-icon sd-sharing"><h3 class="sd-title">Share this:</h3><div class="sd-content"><ul><li class="share-facebook"><a rel="nofollow noopener noreferrer" data-shared="sharing-facebook-4043909" class="share-facebook sd-button share-icon no-text" href="https://www.nipponese.news/%e5%8f%8d%e5%bf%9c-v19-%e5%8f%8d%e5%bf%9c/?share=facebook" target="_blank" aria-labelledby="sharing-facebook-4043909" > <span id="sharing-facebook-4043909" hidden>Share on Facebook (Opens in new window)</span> <span>Facebook</span> </a></li><li class="share-x"><a rel="nofollow noopener noreferrer" data-shared="sharing-x-4043909" class="share-x sd-button share-icon no-text" href="https://www.nipponese.news/%e5%8f%8d%e5%bf%9c-v19-%e5%8f%8d%e5%bf%9c/?share=x" target="_blank" aria-labelledby="sharing-x-4043909" > <span id="sharing-x-4043909" hidden>Share on X (Opens in new window)</span> <span>X</span> </a></li><li class="share-end"></li></ul></div></div></div> <div id='jp-relatedposts' class='jp-relatedposts' > <h3 class="jp-relatedposts-headline"><em>Related</em></h3> </div> </div> <div class="byo-author-box"> <strong>執筆者について: nipponese</strong> <p> Nipponese News編集部は、国内外のニュースを日本語で分かりやすくお届けします。 </p> </div> </div> <aside class="byo-article-side" aria-label="関連記事"> <h2>関連記事</h2> <article> <a class="byo-kicker" href="https://www.nipponese.news/category/%e7%a7%91%e5%ad%a6%ef%bc%86%e3%83%86%e3%82%af%e3%83%8e%e3%83%ad%e3%82%b8%e3%83%bc/">科学&テクノロジー</a> <h3><a href="https://www.nipponese.news/%e5%9c%9f%e6%98%9f%e3%81%ae%e8%a1%9b%e6%98%9f%e3%82%bf%e3%82%a4%e3%82%bf%e3%83%b3%e3%81%a7%e3%82%ab%e3%83%83%e3%82%b7%e3%83%bc%e3%83%8b%e6%8e%a2%e6%9f%bb%e6%a9%9f%e3%81%8c%e6%98%8e%e3%81%8b%e3%81%97/">土星の衛星タイタンでカッシーニ探査機が明かしたメタンの雨と海、長大な季節の変化</a></h3> </article> <article> <a class="byo-kicker" href="https://www.nipponese.news/category/%e7%a7%91%e5%ad%a6%ef%bc%86%e3%83%86%e3%82%af%e3%83%8e%e3%83%ad%e3%82%b8%e3%83%bc/">科学&テクノロジー</a> <h3><a href="https://www.nipponese.news/spacex%e3%81%aefalcon-9%e3%83%ad%e3%82%b1%e3%83%83%e3%83%88%e3%81%8c2026%e5%b9%b48%e6%9c%88%e3%81%ab%e6%9c%88%e9%9d%a2%e8%a1%9d%e7%aa%81%e3%81%b8%e3%80%81%e6%96%b0%e3%81%9f%e3%81%aa%e3%82%af%e3%83%ac/">SpaceXのFalcon 9ロケットが2026年8月に月面衝突へ、新たなクレーター形成の予測</a></h3> </article> <article> <a class="byo-kicker" href="https://www.nipponese.news/category/%e7%a7%91%e5%ad%a6%ef%bc%86%e3%83%86%e3%82%af%e3%83%8e%e3%83%ad%e3%82%b8%e3%83%bc/">科学&テクノロジー</a> <h3><a href="https://www.nipponese.news/google%e3%80%81pixel-9%e3%83%bb10%e3%81%ae%e3%83%90%e3%83%83%e3%83%86%e3%83%aa%e3%83%bc%e6%b6%88%e8%b2%bb%e5%95%8f%e9%a1%8c%e3%82%92%e4%bf%ae%e6%ad%a3-pixel-8a%e3%83%bb9a%e3%81%af9%e6%9c%88%e6%8f%90/">Google、Pixel 9・10のバッテリー消費問題を修正 Pixel 8a・9aは9月提供へ</a></h3> </article> <article> <a class="byo-kicker" href="https://www.nipponese.news/category/%e7%a7%91%e5%ad%a6%ef%bc%86%e3%83%86%e3%82%af%e3%83%8e%e3%83%ad%e3%82%b8%e3%83%bc/">科学&テクノロジー</a> <h3><a href="https://www.nipponese.news/%e5%8d%97%ce%b4%e3%82%a2%e3%82%af%e3%82%a2%e3%83%aa%e3%82%a6%e3%82%b9%e6%b5%81%e6%98%9f%e7%be%a4%e3%81%a8%e3%82%84%e3%81%8e%e5%ba%a7%e3%82%a2%e3%83%ab%e3%83%95%e3%82%a1%e6%b5%81%e6%98%9f%e7%be%a4/">南δアクアリウス流星群とやぎ座アルファ流星群が7月30日に極大、月明かりで観測は困難か</a></h3> </article> <article> <a class="byo-kicker" href="https://www.nipponese.news/category/%e7%a7%91%e5%ad%a6%ef%bc%86%e3%83%86%e3%82%af%e3%83%8e%e3%83%ad%e3%82%b8%e3%83%bc/">科学&テクノロジー</a> <h3><a href="https://www.nipponese.news/apple%e3%81%8c%e3%82%b9%e3%83%9e%e3%83%bc%e3%83%88%e3%82%b0%e3%83%a9%e3%82%b9%e3%81%ae%e7%99%ba%e5%a3%b2%e3%82%922027%e5%b9%b4%e5%be%8c%e5%8d%8a%e3%81%b8%e5%bb%b6%e6%9c%9f%e3%80%81%e3%83%97%e3%83%a9/">Appleがスマートグラスの発売を2027年後半へ延期、プライバシー懸念への対応を優先</a></h3> </article> </aside> </div> <nav class="byo-article-navigation" aria-label="前後の記事"> <div class="byo-newsroom-wrap byo-article-navigation__grid"> <a class="byo-article-navigation__item byo-article-navigation__item--previous" href="https://www.nipponese.news/%e3%83%93%e3%82%b8%e3%83%8d%e3%82%b9%e3%81%ae%e3%83%a0%e3%83%bc%e3%83%89%e3%81%8c%e6%9a%97%e3%81%8f%e3%81%aa%e3%82%8b%e4%b8%ad%e3%80%81%e8%8b%b1%e5%9b%bd%e3%81%ae%e6%b1%82%e4%ba%ba%e6%95%b0%e3%81%af/"> <span class="byo-article-navigation__label">← 前の記事</span> <span class="byo-article-navigation__title">ビジネスのムードが暗くなる中、英国の求人数はパンデミック以来最速のペースで減少</span> </a> <a class="byo-article-navigation__item byo-article-navigation__item--next" href="https://www.nipponese.news/%e3%83%9b%e3%83%bc%e3%83%a0%e3%82%b2%e3%83%bc%e3%83%a0%e3%81%ae%e3%83%81%e3%82%b1%e3%83%83%e3%83%88%e3%82%92%e8%b3%bc%e5%85%a5%e3%81%a7%e3%81%8d%e3%82%8b%e5%a0%b4%e6%89%80/"> <span class="byo-article-navigation__label">次の記事 →</span> <span class="byo-article-navigation__title">ホームゲームのチケットを購入できる場所</span> </a> </div> </nav> </article> </main> </div> </div> <section class="byo-newsroom-footer-links" aria-label="Nipponese News"> <div class="byo-newsroom-wrap"> <div class="byo-newsroom-footer-links__brand">Nipponese News</div> <nav> <a href="https://www.nipponese.news/about-us/">About Us</a> <a href="https://www.nipponese.news/contact/">Contact</a> <a href="https://www.nipponese.news/style-guide/">Style Guide</a> <a href="https://www.nipponese.news/privacy-policy/">Privacy Policy</a> </nav> </div> </section> <div class="site-footer"> <footer class="site-info" aria-label="Site" itemtype="https://schema.org/WPFooter" itemscope> <div class="inside-site-info grid-container"> <div class="copyright-bar"> © 2026 Nipponese News. All rights reserved. <br><span class="byo-footer-contact">お問い合わせ・広告・著作権・不具合に関するご連絡は office@nipponese.news までメールでお願いします。</span></div> </div> </footer> </div> <a title="Scroll back to top" aria-label="Scroll back to top" rel="nofollow" href="#" class="generate-back-to-top" data-scroll-speed="400" data-start-scroll="300" role="button"> <span class="gp-icon icon-arrow-up"><svg viewBox="0 0 330 512" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path d="M305.863 314.916c0 2.266-1.133 4.815-2.832 6.514l-14.157 14.163c-1.699 1.7-3.964 2.832-6.513 2.832-2.265 0-4.813-1.133-6.512-2.832L164.572 224.276 53.295 335.593c-1.699 1.7-4.247 2.832-6.512 2.832-2.265 0-4.814-1.133-6.513-2.832L26.113 321.43c-1.699-1.7-2.831-4.248-2.831-6.514s1.132-4.816 2.831-6.515L158.06 176.408c1.699-1.7 4.247-2.833 6.512-2.833 2.265 0 4.814 1.133 6.513 2.833L303.03 308.4c1.7 1.7 2.832 4.249 2.832 6.515z" fill-rule="nonzero" /></svg></span> </a><script type="speculationrules"> {"prefetch":[{"source":"document","where":{"and":[{"href_matches":"/*"},{"not":{"href_matches":["/wp-*.php","/wp-admin/*","/wp-content/uploads/*","/wp-content/*","/wp-content/plugins/*","/wp-content/themes/byo-newsroom/*","/wp-content/themes/generatepress/*","/*\\?(.+)"]}},{"not":{"selector_matches":"a[rel~=\"nofollow\"]"}},{"not":{"selector_matches":".no-prefetch, .no-prefetch a"}}]},"eagerness":"conservative"}]} </script> <!-- Default Statcounter code for nipponese http://www.nipponese.news/ --> <script type="text/javascript"> var sc_project=12695711; var sc_invisible=1; var sc_security="6ab6c765"; </script> <script type="text/javascript" src="https://www.statcounter.com/counter/counter.js" async></script> <noscript><div class="statcounter"><a title="Web Analytics" href="https://statcounter.com/" target="_blank"><img class="statcounter" src="https://c.statcounter.com/12695711/0/6ab6c765/1/" alt="Web Analytics" referrerPolicy="no-referrer-when-downgrade"></a></div></noscript> <!-- End of Statcounter Code --> <!-- Public Byoviral.com Tracking code --> <script src="https://www.byoviral.com/badge/script?domain=nipponese.news" async defer></script> <!-- End of Byoviral Code --><script id="generate-a11y"> !function(){"use strict";if("querySelector"in document&&"addEventListener"in window){var e=document.body;e.addEventListener("pointerdown",(function(){e.classList.add("using-mouse")}),{passive:!0}),e.addEventListener("keydown",(function(){e.classList.remove("using-mouse")}),{passive:!0})}}(); </script> <div class="gp-modal gp-search-modal" id="gp-search" role="dialog" aria-modal="true" aria-label="Search"> <div class="gp-modal__overlay" tabindex="-1" data-gpmodal-close> <div class="gp-modal__container"> <form role="search" method="get" class="search-modal-form" action="https://www.nipponese.news/"> <label for="search-modal-input" class="screen-reader-text">Search for:</label> <div class="search-modal-fields"> <input id="search-modal-input" type="search" class="search-field" placeholder="Search …" value="" name="s" /> <button aria-label="Search"><span class="gp-icon icon-search"><svg viewBox="0 0 512 512" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="1em" height="1em"><path fill-rule="evenodd" clip-rule="evenodd" d="M208 48c-88.366 0-160 71.634-160 160s71.634 160 160 160 160-71.634 160-160S296.366 48 208 48zM0 208C0 93.125 93.125 0 208 0s208 93.125 208 208c0 48.741-16.765 93.566-44.843 129.024l133.826 134.018c9.366 9.379 9.355 24.575-.025 33.941-9.379 9.366-24.575 9.355-33.941-.025L337.238 370.987C301.747 399.167 256.839 416 208 416 93.125 416 0 322.875 0 208z" /></svg></span></button> </div> </form> </div> </div> </div> <script type="text/javascript"> window.WPCOM_sharing_counts = {"https://www.nipponese.news/%e5%8f%8d%e5%bf%9c-v19-%e5%8f%8d%e5%bf%9c/":4043909}; </script> <script id="force-refresh-js-js-extra"> var forceRefreshLocalizedData = {"apiEndpoint":"https://www.nipponese.news/wp-json/force-refresh/v1/current-version","postId":"4043909","isDebugActive":"","refreshInterval":"120","featureFlags":{"scheduledRefresh":true,"troubleshootingTerminal":false,"troubleshootingSubmitDebug":true},"versionFileUrl":null}; //# sourceURL=force-refresh-js-js-extra </script> <script id="force-refresh-js-js" src="https://www.nipponese.news/wp-content/plugins/force-refresh/dist/js/force-refresh.js?ver=1785693408"></script> <script id="generate-menu-js-before"> var generatepressMenu = {"toggleOpenedSubMenus":true,"openSubMenuLabel":"Open Sub-Menu","closeSubMenuLabel":"Close Sub-Menu"}; //# sourceURL=generate-menu-js-before </script> <script id="generate-menu-js" src="https://www.nipponese.news/wp-content/themes/generatepress/assets/js/menu.min.js?ver=3.6.1"></script> <script id="generate-modal-js" src="https://www.nipponese.news/wp-content/themes/generatepress/assets/dist/modal.js?ver=3.6.1"></script> <script id="generate-navigation-search-js-before"> var generatepressNavSearch = {"open":"Open Search Bar","close":"Close Search Bar"}; //# sourceURL=generate-navigation-search-js-before </script> <script id="generate-navigation-search-js" src="https://www.nipponese.news/wp-content/themes/generatepress/assets/js/navigation-search.min.js?ver=3.6.1"></script> <script id="generate-back-to-top-js-before"> var generatepressBackToTop = {"smooth":true}; //# sourceURL=generate-back-to-top-js-before </script> <script id="generate-back-to-top-js" src="https://www.nipponese.news/wp-content/themes/generatepress/assets/js/back-to-top.min.js?ver=3.6.1"></script> <script async data-wp-strategy="async" fetchpriority="low" id="comment-reply-js" src="https://c0.wp.com/c/7.0.2/wp-includes/js/comment-reply.min.js"></script> <script id="jetpack-stats-js-before"> _stq = window._stq || []; _stq.push([ "view", {"v":"ext","blog":"201233194","post":"4043909","tz":"0","srv":"www.nipponese.news","j":"1:16.1-a.1"} ]); _stq.push([ "clickTrackerInit", "201233194", "4043909" ]); //# sourceURL=jetpack-stats-js-before </script> <script data-wp-strategy="defer" defer fetchpriority="low" id="jetpack-stats-js" src="https://stats.wp.com/e-202631.js"></script> <script id="sharing-js-js-extra"> var sharing_js_options = {"lang":"en","counts":"1","is_stats_active":"1"}; //# sourceURL=sharing-js-js-extra </script> <script id="sharing-js-js" src="https://www.nipponese.news/wp-content/plugins/jetpack/_inc/build/sharedaddy/sharing.min.js?ver=16.1-a.1"></script> <script id="sharing-js-js-after"> var windowOpen; ( function () { function matches( el, sel ) { return !! ( el.matches && el.matches( sel ) || el.msMatchesSelector && el.msMatchesSelector( sel ) ); } document.body.addEventListener( 'click', function ( event ) { if ( ! event.target ) { return; } var el; if ( matches( event.target, 'a.share-facebook' ) ) { el = event.target; } else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-facebook' ) ) { el = event.target.parentNode; } if ( el ) { event.preventDefault(); // If there's another sharing window open, close it. if ( typeof windowOpen !== 'undefined' ) { windowOpen.close(); } windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomfacebook', 'menubar=1,resizable=1,width=600,height=400' ); return false; } } ); } )(); var windowOpen; ( function () { function matches( el, sel ) { return !! ( el.matches && el.matches( sel ) || el.msMatchesSelector && el.msMatchesSelector( sel ) ); } document.body.addEventListener( 'click', function ( event ) { if ( ! event.target ) { return; } var el; if ( matches( event.target, 'a.share-x' ) ) { el = event.target; } else if ( event.target.parentNode && matches( event.target.parentNode, 'a.share-x' ) ) { el = event.target.parentNode; } if ( el ) { event.preventDefault(); // If there's another sharing window open, close it. if ( typeof windowOpen !== 'undefined' ) { windowOpen.close(); } windowOpen = window.open( el.getAttribute( 'href' ), 'wpcomx', 'menubar=1,resizable=1,width=600,height=350' ); return false; } } ); } )(); //# sourceURL=sharing-js-js-after </script> <script id="wp-emoji-settings" type="application/json"> {"baseUrl":"https://s.w.org/images/core/emoji/17.0.2/72x72/","ext":".png","svgUrl":"https://s.w.org/images/core/emoji/17.0.2/svg/","svgExt":".svg","source":{"concatemoji":"https://www.nipponese.news/wp-includes/js/wp-emoji-release.min.js?ver=7.0.2"}} </script> <script type="module"> /*! This file is auto-generated */ const a=JSON.parse(document.getElementById("wp-emoji-settings").textContent),o=(window._wpemojiSettings=a,"wpEmojiSettingsSupports"),s=["flag","emoji"];function i(e){try{var t={supportTests:e,timestamp:(new Date).valueOf()};sessionStorage.setItem(o,JSON.stringify(t))}catch(e){}}function c(e,t,n){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);t=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(n,0,0);const a=new Uint32Array(e.getImageData(0,0,e.canvas.width,e.canvas.height).data);return t.every((e,t)=>e===a[t])}function p(e,t){e.clearRect(0,0,e.canvas.width,e.canvas.height),e.fillText(t,0,0);var n=e.getImageData(16,16,1,1);for(let e=0;e<n.data.length;e++)if(0!==n.data[e])return!1;return!0}function u(e,t,n,a){switch(t){case"flag":return n(e,"\ud83c\udff3\ufe0f\u200d\u26a7\ufe0f","\ud83c\udff3\ufe0f\u200b\u26a7\ufe0f")?!1:!n(e,"\ud83c\udde8\ud83c\uddf6","\ud83c\udde8\u200b\ud83c\uddf6")&&!n(e,"\ud83c\udff4\udb40\udc67\udb40\udc62\udb40\udc65\udb40\udc6e\udb40\udc67\udb40\udc7f","\ud83c\udff4\u200b\udb40\udc67\u200b\udb40\udc62\u200b\udb40\udc65\u200b\udb40\udc6e\u200b\udb40\udc67\u200b\udb40\udc7f");case"emoji":return!a(e,"\ud83e\u1fac8")}return!1}function f(e,t,n,a){let r;const o=(r="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?new OffscreenCanvas(300,150):document.createElement("canvas")).getContext("2d",{willReadFrequently:!0}),s=(o.textBaseline="top",o.font="600 32px Arial",{});return e.forEach(e=>{s[e]=t(o,e,n,a)}),s}function r(e){var t=document.createElement("script");t.src=e,t.defer=!0,document.head.appendChild(t)}a.supports={everything:!0,everythingExceptFlag:!0},new Promise(t=>{let n=function(){try{var e=JSON.parse(sessionStorage.getItem(o));if("object"==typeof e&&"number"==typeof e.timestamp&&(new Date).valueOf()<e.timestamp+604800&&"object"==typeof e.supportTests)return e.supportTests}catch(e){}return null}();if(!n){if("undefined"!=typeof Worker&&"undefined"!=typeof OffscreenCanvas&&"undefined"!=typeof URL&&URL.createObjectURL&&"undefined"!=typeof Blob)try{var e="postMessage("+f.toString()+"("+[JSON.stringify(s),u.toString(),c.toString(),p.toString()].join(",")+"));",a=new Blob([e],{type:"text/javascript"});const r=new Worker(URL.createObjectURL(a),{name:"wpTestEmojiSupports"});return void(r.onmessage=e=>{i(n=e.data),r.terminate(),t(n)})}catch(e){}i(n=f(s,u,c,p))}t(n)}).then(e=>{for(const n in e)a.supports[n]=e[n],a.supports.everything=a.supports.everything&&a.supports[n],"flag"!==n&&(a.supports.everythingExceptFlag=a.supports.everythingExceptFlag&&a.supports[n]);var t;a.supports.everythingExceptFlag=a.supports.everythingExceptFlag&&!a.supports.flag,a.supports.everything||((t=a.source||{}).concatemoji?r(t.concatemoji):t.wpemoji&&t.twemoji&&(r(t.twemoji),r(t.wpemoji)))}); //# sourceURL=https://www.nipponese.news/wp-includes/js/wp-emoji-loader.min.js </script> </body> </html> <!-- Performance optimized by Redis Object Cache. Learn more: https://wprediscache.com Retrieved 3126 objects (1 MB) from Redis using PhpRedis (v6.3.0). --> <!-- Page cached by LiteSpeed Cache 7.8.1 on 2026-08-02 23:45:48 -->