react-cookie-law icon indicating copy to clipboard operation
react-cookie-law copied to clipboard

setState during render.

Open pinguks opened this issue 5 years ago • 3 comments

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

pinguks avatar Jul 02 '20 13:07 pinguks

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

dowrow avatar Feb 18 '21 16:02 dowrow

@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?

guvarallo avatar Jun 15 '21 17:06 guvarallo

@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)}

orutra11 avatar Sep 06 '21 11:09 orutra11