# React Router v7でConsoleを削除するメモ

2 min read
Table of Contents

React Router v7で謎のConsoleが出続ける

React Router v7で開発していると下記コンソールが常に出ていた。

Production Buildすれば消えると思っていたので気にしなかったけど、そんなことなかったので初めて意識した。

💿 Hey developer 👋. You can provide a way better UX than this when your app is loading JS modules and/or running `clientLoader` functions. Check out https://reactrouter.com/start/framework/route-module#hydratefallback for more information.

訳すると、

こんにちは、デベロッパーの方へ。

お使いのアプリがJSモジュールを読み込んだり、clientLoader関数を実行したりする際、これよりもずっと優れたUX(ユーザー体験)を提供できます。詳細については、https://reactrouter.com/start/framework/route-module#hydratefallback をご覧ください。

とのこと。

つまりもっといい開発できますよ、ということ。

公式を見に行くと、

On initial page load, the route component renders only after the client loader is finished. If exported, a HydrateFallback can render immediately in place of the route component.

HydrateFallbackをエクスポートすると、初回レンダリング時、クライントローダーが完了するまで、HydrateFallbackでエクスポートしたコンポーネントを表示してくれるとのこと。

追加して、

ずっと優れたUX(ユーザー体験)を提供でき

るようになった。

My avatar

Thanks for reading my blog post! Feel free to check out my other posts or contact me via the social links in the footer.


More Posts

Comments