Conversation
* Browser history fix/hack. --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
✅ Deploy Preview for adapt-giving ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Pull request overview
Release-focused PR updating the Next.js/Netlify/Storyblok dependency set and adjusting the search experience to better handle InstantSearch state across navigation.
Changes:
- Bump core deps (Next.js, Netlify functions/plugin, Storyblok SDKs, cookies-next, react-instantsearch-nextjs).
- Add an InstantSearch state reset workaround in the Search component (key +
future.preserveSharedStateOnUnmount: false). - Make
stateToRouteresilient to missing index UI state.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| package.json | Updates dependency versions for the v7.1.6 release set. |
| package-lock.json | Locks updated transitive dependency graph from the version bumps. |
| components/Search/Search.tsx | Forces InstantSearch state reset across navigation and hardens route mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| useEffect(() => { | ||
| // eslint-disable-next-line react-hooks/set-state-in-effect | ||
| setKey(`search-component-${Date.now()}`); | ||
| }, []); |
There was a problem hiding this comment.
The useEffect updates key on initial mount, which forces <InstantSearchNext> to unmount/remount immediately after first render (and in React StrictMode dev it may happen twice). This can trigger an extra search request and requires an eslint disable. Consider generating a per-mount key without a post-render state update (e.g., initialize it via a lazy useState initializer or useRef) and remove the set-state-in-effect suppression.
| "@netlify/functions": "^5.1.4", | ||
| "@next/third-parties": "^16.2.0", | ||
| "@storyblok/react": "^5.4.22", |
There was a problem hiding this comment.
PR title/description indicates a release for v7.1.6, but package.json still declares version 7.1.5. If this PR is meant to publish v7.1.6, the package version should be bumped accordingly (or the PR metadata adjusted if releases are handled elsewhere).
READY FOR REVIEW
Summary