barbarbar338 / react-state-query

πŸš€ Save state of your React app in URL!

Home Page:https://npmjs.com/react-state-query

Repository from Github https://github.combarbarbar338/react-state-queryRepository from Github https://github.combarbarbar338/react-state-query

stars license supportServer forks issues

Logo

React State Query

Save state of your React app in URL!
Get support Β»

Report Bug Β· Request Feature

πŸ“¦ Installation

  • Using yarn: yarn add react-state-query
  • Using npm: npm i react-state-query

πŸ€“ Usage

Real-life example: https://react-state-query.glitch.me

import { useStateQuery } from "react-state-query";

function App() {
	const [value, setValue] = useStateQuery(
		"query-key",
		"default value not required",
	);

	return (
		<div>
			<input
				type="text"
				value={value}
				onChange={(e) => {
					setValue(e.target.value); // query also updated, refresh the page and see the same value
				}}
			/>
		</div>
	);
}

export default App;

πŸ“„ License

Copyright © 2023 Barış DEMİRCİ.

Distributed under the GPL-3.0 License. See LICENSE for more information.

🧦 Contributing

Feel free to use GitHub's features.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/my-feature)
  3. Run prettier and eslint (npm run format && npm run lint)
  4. Commit your Changes (git commit -m 'my awesome feature my-feature')
  5. Push to the Branch (git push origin feature/my-feature)
  6. Open a Pull Request

πŸ”₯ Show your support

Give a ⭐️ if this project helped you!

πŸ“ž Contact

About

πŸš€ Save state of your React app in URL!

https://npmjs.com/react-state-query

License:GNU General Public License v3.0


Languages

Language:TypeScript 100.0%