Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
client: Fix spurious reloading on entry activation
When an article is activated, its `id` will be appended to URL. `NavigateFunction` depends on `Location` so when the URL was updated, the `useEffect` callback would be triggered due to the dependency change. The callback would then reload the entries list. Even worse, when using the unread filter, the just activated entry would disappear. However, we should not actually need to pass the `navigate` function: The `Location` is really only a dependency so that `pathname: null` can use the current location, https://github.com/remix-run/react-router/blob/a3e4b8ed875611637357647fcf862c2bc61f4e11/packages/react-router/lib/router/utils.ts#L1267 and we always do set a string `pathname`. And the other dependencies appear to be static: https://github.com/remix-run/react-router/blob/a3e4b8ed875611637357647fcf862c2bc61f4e11/packages/react-router/lib/hooks.tsx#L292-L296 This got broken in 88deede.
- Loading branch information