paramander / contentful-rich-text-vue-renderer

Render Contentful Rich Text field using Vue
https://www.npmjs.com/package/contentful-rich-text-vue-renderer
MIT License
38 stars 12 forks source link

Avoid render loops in node-renderers test #34

Closed NWRichmond closed 3 years ago

NWRichmond commented 3 years ago

What Does This Do?

Fixes #33 by not mutating node.content during text node rendering.

Many thanks to @tolgap for providing this solution!

Demonstration

Before

Vue warns about an infinite update loop:

(Code Sandbox)

Vue warns, 'You may have an infinite update loop in a component render function.'

After

No warning about infinite update loops:

(Code Sandbox)

No warnings about infinite update loops
tolgap commented 3 years ago

@NWRichmond Thank you!