1.1.3 • Published 3 years ago
@hansolbangul/history-state v1.1.3
@hansolbangul/history-state
A React hook for managing state within the browser's history.
📦 Installation
Using npm:
npm install @hansolbangul/history-stateUsing yarn:
yarn add @hansolbangul/history-state🔍 Usage
To use the useHistoryState hook:
Import it:
import useHistoryState from '@hansolbangul/history-state';Use it within your component:
function YourComponent() { const [historyState, setHistoryState] = useHistoryState({ initialState: 'Your Initial State', key: 'yourKey' }); // ... your component logic ... }
⚠️ Common Issues
Scope Naming Issue
If you encounter the following error:
npm ERR! Invalid name: "hansolbangul/history-state"Make sure to check the name field in your package.json. It should look like this:
"name": "@hansolbangul/history-state"Then, use the appropriate scoped name when installing or referencing the package.
🙌 Contributing
Contributions are welcomed! If you discover issues or have features to suggest, please open an issue or submit a pull request.