The duplicate search term doesn't stay in sync between the redux and input when parsing from the URL history.
You see two main bugs, both with the same root cause:
If you load from a URL, the search term is set in the redux store, but not he actual search input
When you use forward/back, we change the redux state, but not the input value
Both are because the local state of the debounced search is completely decoupled from the redux values.
Steps to reproduce
Add a search term and search
Refresh the page with the new URL -- no search term!
Browser
No response
Other notes
What we need to do is...
Make the DebouncedSearch optionally take in "controlled" state values (searchTerm, setSearchTerm) in the props. If we provide those, use those instead of the local state values.
Take the parent duplicate search component and sync the local state with the redux value
Quick summary
The duplicate search term doesn't stay in sync between the redux and input when parsing from the URL history.
You see two main bugs, both with the same root cause:
Both are because the local state of the debounced search is completely decoupled from the redux values.
Steps to reproduce
Browser
No response
Other notes
What we need to do is...
DebouncedSearch
optionally take in "controlled" state values (searchTerm
,setSearchTerm
) in the props. If we provide those, use those instead of the local state values.