Add useSearchParam

This commit is contained in:
Chalarangelo
2021-09-09 21:54:02 +03:00
parent 35aa1dffe4
commit 4a0f6861cf
2 changed files with 65 additions and 1 deletions

View File

@@ -4,7 +4,7 @@ tags: hooks,state,effect,advanced
firstSeen: 2021-10-02T05:00:00-04:00
---
Tracks the browser's location hash value, and allows changin it.
Tracks the browser's location hash value, and allows changing it.
- Use the `useState()` hook to lazily get the `hash` property of the `Location` object.
- Use the `useCallback()` hook to create a handler that updates the state.