Skip to content

Conversation

@miya
Copy link
Member

@miya miya commented Dec 5, 2025

@miya miya requested a review from yuki-takei December 5, 2025 03:38
@miya miya self-assigned this Dec 5, 2025
// biome-ignore lint/style/noRestrictedImports: no-problem dynamic import
() => import('~/features/search/client/components/PrivateLegacyPages'),
{ ssr: false },
);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NextPage の中で dynamic import していたのでリレンダリングのたびに flickering していた

// biome-ignore lint/correctness/useExhaustiveDependencies: only run on mount
useEffect(() => {
setSearchKeyword(initQ);
}, []);
Copy link
Member Author

@miya miya Dec 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

バグの原因

useSearchKeyword() の初期値である "" (空文字列) で検索していたことにより、マイグレーション対象のページが表示されていなかった。

修正方法

master の仕様と合わせて /_private-legacy-pages にアクセスしたタイミングで '/' の検索結果を表示するように改修。

NextPage で atom を "/" で hydrate することも考えたが、useSetSearchKeyword を使って値を更新することで SSoT を実現しているので atom を直接書き換えることはせず CSR 後に useEffect の中で useSetSearchKeyword を実行するようにしている。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants