Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setState during render. #21

Open
pinguks opened this issue Jul 2, 2020 · 3 comments
Open

setState during render. #21

pinguks opened this issue Jul 2, 2020 · 3 comments

Comments

@pinguks
Copy link

pinguks commented Jul 2, 2020

The cookie banner component calls the passed callback function immediately during the rendering, without waiting for it to mount.

@dowrow
Copy link

dowrow commented Feb 18, 2021

Are you passing it as ={callback} or ={callback()} ?

@guvarallo
Copy link

@pinguks I believe I have the same issue. Does it happen only after you clicked accept all? That is, when the cookies already exist for all the options?

@orutra11
Copy link

orutra11 commented Sep 6, 2021

@guvarallo did you find a fix for that? I get a Warning: Cannot update a component while rendering a different component after accepting (it is supposed to close a modal accept={()=>setIsOpen(false)}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants