セキュリティ
これは決して包括的なガイドではありませんが、React Router は、_セキュリティ_という_非常に大きな_傘の下にあるいくつかの側面に対処するのに役立つ機能を提供します。
Content-Security-Policy
アプリケーションで Content-Security-Policy (CSP) を実装している場合、特に unsafe-inline ディレクティブを使用している場合は、HTML でレンダリングされるインライン <script> 要素に nonce 属性を指定する必要があります。これは、インラインスクリプトを生成するすべての API で指定する必要があります。以下を含みます。
<Scripts nonce>(root.tsx)<ScrollRestoration nonce>(root.tsx)<ServerRouter nonce>(entry.server.tsx)renderToPipeableStream(..., { nonce })(entry.server.tsx)renderToReadableStream(..., { nonce })(entry.server.tsx)