@hansolbangul/history-state
TypeScript icon, indicating that this package has built-in type declarations

1.1.3 • Public • Published

@hansolbangul/history-state

A React hook for managing state within the browser's history.

📦 Installation

Using npm:

npm install @hansolbangul/history-state

Using yarn:

yarn add @hansolbangul/history-state

🔍 Usage

To use the useHistoryState hook:

  1. Import it:

    import useHistoryState from '@hansolbangul/history-state';
  2. 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.

/@hansolbangul/history-state/

    Package Sidebar

    Install

    npm i @hansolbangul/history-state

    Weekly Downloads

    15

    Version

    1.1.3

    License

    MIT

    Unpacked Size

    5 kB

    Total Files

    4

    Last publish

    Collaborators

    • hansolbangul