Alex-D / Cookies-EU-banner

1kb vanilla JS script which manages cookies consent banner display like asked by GDPR
http://alex-d.github.io/Cookies-EU-banner/
MIT License
441 stars 57 forks source link

With the need to translate the message you run into all kinds of issues #61

Open codingyourlife opened 4 years ago

codingyourlife commented 4 years ago

Hey! we decided on this banner but want to translate the message inside the banner via i18next. Therefore we need to have the Cookie banner as separate component. Therefore we need to import cookies-eu-banner via import statement. If I do that I run into issues like 'dataLayer' is not defined etc.

So steps to reproduce is simply:

import React from "react";
import CookiesEuBanner from "./cookies-eu-banner.js";

const CustomCookieConsent = () => {
    return (
        <>Please fix the errors you run into</>
    );
};
export default CustomCookieConsent;

It would be great to have such an example in the readme.