Skip to content

Fix stale query closure in useSearchState URL-to-state effect #900

Description

@RUKAYAT-CODER

Overview
In src/hooks/useSearchState.ts the URL-to-state effect (lines 181-196) reads query fields to diff against incoming params but its dependency array is only [searchParams] (with an eslint-disable). The captured query is stale, so comparisons run against outdated state and can skip legitimate updates or cause redundant setter calls during back/forward navigation. Include query in the comparison or read it from a ref.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions