Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(render-function): clear void calls #1580

Merged
merged 1 commit into from
Jul 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading