Skip to content
This repository was archived by the owner on Nov 9, 2024. It is now read-only.

Commit 2d141fc

Browse files
committed
fix: remove mounted call
1 parent 58dfc5a commit 2d141fc

File tree

2 files changed

+10
-16
lines changed

2 files changed

+10
-16
lines changed

src/Tippy.js

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ export default function TippyGenerator(tippy) {
3030
const isSingletonMode = singleton !== undefined;
3131

3232
const [attrs, setAttrs] = useState({});
33-
const [mounted, setMounted] = useState(false);
3433
const [singletonContent, setSingletonContent] = useState();
3534
const mutableBox = useMutableBox(() => ({
3635
container: ssrSafeCreateDiv(),
@@ -118,8 +117,6 @@ export default function TippyGenerator(tippy) {
118117
});
119118
}
120119

121-
setMounted(true);
122-
123120
return () => {
124121
instance.destroy();
125122
singleton?.cleanup(instance);
@@ -213,13 +210,10 @@ export default function TippyGenerator(tippy) {
213210
},
214211
})
215212
: null}
216-
{mounted &&
217-
createPortal(
218-
render
219-
? render(toDataAttributes(attrs), singletonContent)
220-
: content,
221-
mutableBox.container,
222-
)}
213+
{createPortal(
214+
render ? render(toDataAttributes(attrs), singletonContent) : content,
215+
mutableBox.container,
216+
)}
223217
</>
224218
);
225219
}

test/__snapshots__/Tippy.test.js.snap

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@ exports[`<Tippy /> render prop 1`] = `
2222
exports[`<Tippy /> render prop preserve popperOptions 1`] = `
2323
Object {
2424
"modifiers": Array [
25+
Object {
26+
"enabled": true,
27+
"fn": [Function],
28+
"name": "x",
29+
"phase": "main",
30+
},
2531
Object {
2632
"enabled": true,
2733
"fn": [Function],
@@ -31,12 +37,6 @@ Object {
3137
"computeStyles",
3238
],
3339
},
34-
Object {
35-
"enabled": true,
36-
"fn": [Function],
37-
"name": "x",
38-
"phase": "main",
39-
},
4040
],
4141
"strategy": "fixed",
4242
}

0 commit comments

Comments
 (0)