Skip to content

Commit

Permalink
Merge pull request #809 from storyblok/chore/revert-watcher-richtext-…
Browse files Browse the repository at this point in the history
…change

Revert "refactor: enhance reactivity in StoryblokRichText by watching both doc and resolvers with deep true"
  • Loading branch information
alvarosabu authored Jan 15, 2025
2 parents 4d7a922 + 4ed679a commit 71cd136
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/components/StoryblokRichText.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ const props = defineProps<StoryblokRichTextProps>();
const renderedDoc = ref();
const root = () => renderedDoc.value;
// Watch both props using an array of getter functions
watch([() => props.doc, () => props.resolvers], ([doc, resolvers]) => {
watch(props.doc, (doc) => {
const { render } = useStoryblokRichText({
resolvers: (resolvers as StoryblokRichTextResolvers<VNode>) ?? {},
resolvers: (props.resolvers as StoryblokRichTextResolvers<VNode>) ?? {},
});
renderedDoc.value = render(doc as StoryblokRichTextNode<VNode>);
}, {
immediate: true,
deep: true,
});
</script>

Expand Down

0 comments on commit 71cd136

Please sign in to comment.