0.4.0 • Published 4 years ago
kantan-hooks v0.4.0
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
4 years ago
0.3.5
4 years ago
0.3.8
4 years ago
0.3.7
4 years ago
0.3.2
4 years ago
0.4.0
4 years ago
0.3.1
4 years ago
0.3.4
4 years ago
0.3.3
4 years ago
1.2.8
4 years ago
1.2.7
4 years ago
1.3.0
4 years ago
1.2.9
4 years ago
1.2.0
4 years ago
1.1.9
4 years ago
1.1.8
4 years ago
1.2.6
4 years ago
1.1.7
4 years ago
1.2.5
4 years ago
1.2.4
4 years ago
1.2.3
4 years ago
1.2.2
4 years ago
1.2.1
4 years ago
1.1.6
4 years ago
1.1.5
4 years ago
1.1.4
4 years ago
1.1.3
4 years ago
1.1.1
4 years ago
1.1.0
4 years ago
1.0.9
4 years ago
1.0.8
4 years ago
1.0.7
4 years ago
1.0.6
4 years ago
1.0.5
4 years ago
1.0.4
4 years ago
1.0.3
4 years ago
1.0.2
4 years ago
1.0.1
4 years ago
1.0.0
4 years ago