AlessioGr / payload-plugin-lexical

Extends payload CMS with Meta's lexical RichText editor - a much more advanced and customizable richtext editor
MIT License
144 stars 6 forks source link

Cannot update a component (`Form`) while rendering a different component (`LexicalRichTextFieldComponent2`). #13

Closed johannesschaffer closed 1 year ago

johannesschaffer commented 1 year ago

Warning: Cannot update a component (Form) while rendering a different component (LexicalRichTextFieldComponent2). To locate the bad setState() call insideLexicalRichTextFieldComponent2, follow the stack trace as described in https://reactjs.org/link/setstate-in-render

This is logged in the browser console after using the editor in a fresh Collection. (As far as I'm aware) it doesn't break anything, just thought I'd let you know.

AlessioGr commented 1 year ago

Warning: Cannot update a component (Form) while rendering a different component (LexicalRichTextFieldComponent2). To locate the bad setState() call insideLexicalRichTextFieldComponent2, follow the stack trace as described in https://reactjs.org/link/setstate-in-render

This is logged in the browser console after using the editor in a fresh Collection. (As far as I'm aware) it doesn't break anything, just thought I'd let you know.

Yep, I'm aware of that. But to be honest, I'm really not sure what exactly causes it. Would appreciate if anyone has some ideas what it could be! At least it doesn't seem to have any negative effects

AlessioGr commented 1 year ago

Hmm, testing it out currently, it only seems to happen during dev—not in production. Weird!

AlessioGr commented 1 year ago

@johannesschaffer just fixed this with #22 in v0.5.0 :)