Problem I just saw in a code review: Using useEffect to copy URL search...


Problem I just saw in a code review: Using useEffect to copy URL search params to state.

Solution: Use the URL as the single source of truth.

Example:

View original on X