Skip to content

Commit

Permalink
fix: Fix destructuring props removing reactivity
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisGV04 committed Oct 2, 2023
1 parent 0a640a3 commit 7fd1f81
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/runtime/components/data/CmsRichText.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ export default defineComponent({
};
}>,

setup({ content, as }, { attrs, slots }) {
setup(props, { attrs, slots }) {
function _serialize(children?: RichTextChildren): RawChildren[] | null {
if (!children) return null;

Expand Down Expand Up @@ -111,8 +111,8 @@ export default defineComponent({
});
}

const children = _serialize(content);
const children = _serialize(props.content);
if (!children) return h("div", { ...attrs }, "No rich text provided");
return () => h(as, { ...attrs }, ...children);
return () => h(props.as, { ...attrs }, ...children);
},
});
4 changes: 2 additions & 2 deletions src/runtime/components/elements/Link.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default defineComponent<Props>({

// We extract the "custom" prop to avoid overrides
// eslint-disable-next-line @typescript-eslint/no-unused-vars
setup({ custom, ...props }, ctx) {
setup(props, ctx) {
const $route = useRoute();

function resolveLinkClass(
Expand Down Expand Up @@ -90,7 +90,7 @@ export default defineComponent<Props>({
)
: h(
NuxtLink,
{ custom: true, ...props },
{ custom: true, ...omit(props, ["custom"]) },
{
default: ({
route,
Expand Down

0 comments on commit 7fd1f81

Please sign in to comment.