Skip to content

Commit

Permalink
refactor(render-function): clear void calls
Browse files Browse the repository at this point in the history
  • Loading branch information
victorcg88 committed Jul 30, 2024
1 parent 71c08db commit 04df4ae
Show file tree
Hide file tree
Showing 8 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion packages/x-components/src/components/display-emitter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
* because Vue2 only allows a single root node. Then, `getCurrentInstance()?.proxy?.$el` to
* retrieve the HTML element in both versions.
*/
return () => slots.default?.()[0] ?? h();
return () => slots.default?.()[0] ?? '';
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
{ immediate: true }
);
return () => slots.default?.({ result: resultToProvide.value })[0] ?? h();
return () => slots.default?.({ result: resultToProvide.value })[0] ?? '';
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import { h, SetupContext, VNode } from 'vue';
*/
export function useNoElementRender(
slots: { [key: string]: VNode[] | undefined } | SetupContext['slots']
): VNode | VNode[] {
): VNode | VNode[] | string {
const defaultSlotContent = typeof slots.default === 'function' ? slots.default() : slots.default;

return defaultSlotContent ?? h();
return defaultSlotContent ?? '';
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
}
});
return () => slots.default?.()[0] ?? h();
return () => slots.default?.()[0] ?? '';
}
});
</script>
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
xBus.emit('UserChangedExtraParams', { [props.name]: newValue });
}
return () => slots.default?.({ value, updateValue })[0] ?? h();
return () => slots.default?.({ value, updateValue })[0] ?? '';
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
);
provide('filters', filtersWithResults);
return () => slots.default?.({ filters: filtersWithResults.value }) ?? h();
return () => slots.default?.({ filters: filtersWithResults.value }) ?? '';
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
});
provide('filters', sortedFilters);
return () => slots.default?.({ filters: sortedFilters.value }) ?? h();
return () => slots.default?.({ filters: sortedFilters.value }) ?? '';
}
});
</script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
* because Vue2 only allows a single root node. Then, `getCurrentInstance()?.proxy?.$el` to
* retrieve the HTML element in both versions.
*/
return () => slots.default?.()[0] ?? h();
return () => slots.default?.()[0] ?? '';
}
});
</script>
Expand Down

0 comments on commit 04df4ae

Please sign in to comment.