Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useUrlState doesn't delete initialState when state is set to undefined #2549

Open
Gusis93 opened this issue May 13, 2024 · 0 comments
Open

Comments

@Gusis93
Copy link

Gusis93 commented May 13, 2024

In relation to #890

When trying to delete a state, the state will always go back to its initial state

Steps to reproduce

  • Use the hook with an initial state
const [state, setState] = useUrlState({
   someState: 'Initial State
})
  • Try to delete said state:
setState({someState: undefined});

Expected:

  • someState is not anymore

Actual:

  • state is: {someState: 'Initial State'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant