React Qstate: A react hook that allows the state to be saved in the URL
npm install react-qstate- Have the exactly same UI
- A user can share the link on social and whoever clicks on it will have the same ui
- Can be saved as a bookmark and will bring back to the same UI
- You can use the "back" button to go back through the states
- It can help search engine optimization
- and more...
``bash`
npm install react-qstate
`bash`
pnpm add react-qstate
`bash`
yarn add react-qstate
`bash`
bun add react-qstate
hook`js
import { useQueryState } from "react-qstate";function App() {
const [count, setCount] = useQueryState("counter", 0);
return (
You clicked {count} times
);
}
``