Skip to content

1.0.3

Latest
Compare
Choose a tag to compare
@mayan-sharma mayan-sharma released this 20 Oct 16:32
· 2 commits to master since this release

Introduced useCookie hook.

const { cookie, setCookie, removeCookie } = useCookie(cookie, value);

Usage

import { useCookie } from "use-everything";

function App() {

  const { cookie, setCookie, removeCookie } = useCookie('balle', 'shava');

  return (
    <div>
      {JSON.stringify(cookie)}
      <button onClick={() => setCookie('bhature')}>Set</button>
      <button onClick={removeCookie}>Remove</button>
    </div>
  );
}

export default App;