3.0.1 • Published 2 years ago

@weahead/react-cookie-consent-hook v3.0.1

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
2 years ago

react-cookie-consent-hook

A simple hook for managing cookies for consent.

Motivation

We wanted something as simple as a hook to manage consent cookies for our applications. We started using react-cookie but it was too broad for our use case, so this hook is inspired by react-cookie but more narrow in its use-case.

Features

  • Simple API for reading/writing cookies for consent management

API

Component

CookieConsentProvider

Wrap your app inside it.

Hook

useCookieConsent

Returns an array, similar to useState, with the first being cookies, an object with all cookies split in key/value pairs, and the second being setCookie, a function for setting a new cookie.

3.0.1

2 years ago

3.0.0

2 years ago

1.1.1

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.5

3 years ago

2.0.4

3 years ago

2.0.6

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.1.0

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago