Remove React Router's useNavigate dependency #1270
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Related Ticket: Contributes to #1108
This aims to ensure catalog filters work correctly in Next.js.
Description of Changes
Removes the usage of React Router's
useNavigate
hook in the library to make it more agnostic of routing frameworks, allowing it to work better with Next.js instances.Changes included:
commit
function touseQsStateCreator
. It appears this was the only place where theuseNavigate
function was effectively in use. I tried using the defaultcommit
function from the qs-state-hook library, but it doesn't work with Next.jsValidation / Testing
Using
veda-config
:Using
next-veda-ui
instance:veda-ui/docs/development/REGISTRY.md
app/(datasets)/data-catalog/catalog.tsx
(this avoids build errors caused by type issues)http://localhost:3000/data-catalog
. Filter changes are reflected in the URL, and reloading populates the filter panel as expectedThis is ready for review.