Skip to content

hansolbangul/history-state

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

@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.

About

React hook for manipulating browser history state.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published