Skip to content

Commit 3664ede

Browse files
committed
[@mantine/core] Tooltip: Fix component not throwing erro when used with string (#8694)
1 parent 117b3d6 commit 3664ede

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • packages/@mantine/core/src/components/Tooltip

packages/@mantine/core/src/components/Tooltip/Tooltip.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,9 @@ export const Tooltip = factory<TooltipFactory>((_props, ref) => {
236236

237237
const child = getSingleElementChild(children);
238238
if (!target && !child) {
239-
return null;
239+
throw new Error(
240+
'[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported'
241+
);
240242
}
241243

242244
if (target) {

0 commit comments

Comments
 (0)