0.4.0 • Published 3 years ago

kantan-hooks v0.4.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Kantan-Hooks

Kantan-Hooks is a lightweight React Hooks library. The project is still work-in-progress, and the Documentation can be found here.

Get started

Run the following command

npm install kantan-hooks

Or do it with yarn:

yarn add kantan-hooks

Next, import the hook that you need. Learn more in the documentation.

import { useLocalStorage } from "kantan-hooks";

export default function LocalStorage() {
  const [theme, setTheme] = useLocalStorage("dark", "theme");
  const newTheme = theme === "dark" ? "light" : "dark";
  return (
    <div>
      <h1>current theme {theme}</h1>
      <button onClick={() => setTheme(newTheme)}>change Theme</button>
      <button onClick={() => window.location.reload()}>
        Refresh window and check if your state persists!
      </button>
    </div>
  );
}
0.3.6

3 years ago

0.3.5

3 years ago

0.3.8

3 years ago

0.3.7

3 years ago

0.3.2

3 years ago

0.4.0

3 years ago

0.3.1

3 years ago

0.3.4

3 years ago

0.3.3

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.3.0

3 years ago

1.2.9

3 years ago

1.2.0

3 years ago

1.1.9

3 years ago

1.1.8

3 years ago

1.2.6

3 years ago

1.1.7

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago