New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-cookie-consent

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-cookie-consent - npm Package Compare versions

Comparing version 1.7.0 to 1.8.0

5

build/index.js

@@ -635,2 +635,3 @@ module.exports =

cookieName = _props2.cookieName,
cookieValue = _props2.cookieValue,
expires = _props2.expires,

@@ -647,3 +648,3 @@ hideOnAccept = _props2.hideOnAccept,

_jsCookie2.default.set(cookieName, true, _extends({ expires: expires }, extraCookieOptions));
_jsCookie2.default.set(cookieName, cookieValue, _extends({ expires: expires }, extraCookieOptions));

@@ -744,2 +745,3 @@ if (hideOnAccept) {

cookieName: _propTypes2.default.string,
cookieValue: _propTypes2.default.oneOfType([_propTypes2.default.string, _propTypes2.default.bool, _propTypes2.default.number]),
debug: _propTypes2.default.bool,

@@ -763,2 +765,3 @@ expires: _propTypes2.default.number,

cookieName: "CookieConsent",
cookieValue: true,
buttonText: "I understand",

@@ -765,0 +768,0 @@ debug: false,

2

package.json

@@ -7,3 +7,3 @@ {

},
"version": "1.7.0",
"version": "1.8.0",
"description": "A small, simple and customizable cookie consent bar for use in React applications.",

@@ -10,0 +10,0 @@ "main": "build/index.js",

@@ -88,2 +88,3 @@ # :cookie: react-cookie-consent :cookie:

| cookieName | string | "CookieConsent" | Name of the cookie used to track whether the user has agreed. |
| cookieValue | string or boolean or number | true | Value to be saved under the cookieName. |
| onAccept | function | `() => {}` | Function to be called after the accept button has been clicked. |

@@ -172,5 +173,5 @@ | debug | boolean | undefined | Bar will be drawn regardless of cookie for debugging purposes. |

```js
<CookieConsent
acceptOnScroll={true}
acceptOnScrollPercentage={50}
<CookieConsent
acceptOnScroll={true}
acceptOnScrollPercentage={50}
onAccept={() => {alert("consent given")}}

@@ -186,3 +187,3 @@ >

```js
<CookieConsent
<CookieConsent
extraCookieOptions={{domain: 'myexample.com'}}

@@ -189,0 +190,0 @@ >

@@ -92,3 +92,3 @@ import React, { Component } from "react";

accept() {
const { cookieName, expires, hideOnAccept, onAccept, extraCookieOptions } = this.props;
const { cookieName, cookieValue, expires, hideOnAccept, onAccept, extraCookieOptions } = this.props;

@@ -100,3 +100,3 @@ // fire onAccept

Cookies.set(cookieName, true, { expires: expires, ...extraCookieOptions });
Cookies.set(cookieName, cookieValue, { expires: expires, ...extraCookieOptions });

@@ -189,2 +189,7 @@ if (hideOnAccept) {

cookieName: PropTypes.string,
cookieValue: PropTypes.oneOfType([
PropTypes.string,
PropTypes.bool,
PropTypes.number
]),
debug: PropTypes.bool,

@@ -208,2 +213,3 @@ expires: PropTypes.number,

cookieName: "CookieConsent",
cookieValue: true,
buttonText: "I understand",

@@ -210,0 +216,0 @@ debug: false,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc