Skip to content

Re-render cookie consent after cookieconsent.run(<config_object>) has already been executed #489

Answered by orestbida
Chayemor asked this question in Q&A
Discussion options

You must be logged in to vote

The plugin is not a react component so any state change won't be reflected unless you completely reset and then re-run the plugin.

If possible only call run() once, as shown in this demo.

You can use updateLanguage('<lang>', true) to refresh the current translation in both modals.

E.g.

cc.getConfig('languages').en.consent_modal.title = 'New title';
cc.updateLanguage('en', true);

Note: v3 is more suited for react based frameworks

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Chayemor
Comment options

Answer selected by Chayemor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants