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

Commit b7b78a0

Browse files
committed
refactor: defer plugins passing to props (#150)
1 parent 91c796c commit b7b78a0

File tree

7 files changed

+13
-29
lines changed

7 files changed

+13
-29
lines changed

index.d.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ export interface TippyProps extends Omit<Partial<KnownProps>, 'content'> {
1515
visible?: boolean;
1616
enabled?: boolean;
1717
className?: string;
18-
plugins?: Plugin[];
1918
singleton?: (instance: Instance) => void;
2019
[key: string]: any;
2120
}
@@ -29,7 +28,6 @@ export interface TippySingletonProps extends Partial<KnownProps> {
2928
children: Array<React.ReactElement<any>>;
3029
enabled?: boolean;
3130
className?: string;
32-
plugins?: Plugin[];
3331
[key: string]: any;
3432
}
3533

package-lock.json

Lines changed: 7 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
},
5252
"dependencies": {
5353
"prop-types": "^15.6.2",
54-
"tippy.js": "^5.0.2"
54+
"tippy.js": "^5.1.0"
5555
},
5656
"peerDependencies": {
5757
"react": ">=16.8",

src/Tippy.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export function Tippy({
1313
children,
1414
content,
1515
className,
16-
plugins,
1716
visible,
1817
singleton,
1918
enabled = true,
@@ -54,7 +53,7 @@ export function Tippy({
5453

5554
// CREATE
5655
useIsomorphicLayoutEffect(() => {
57-
const instance = tippy(component.ref, props, plugins);
56+
const instance = tippy(component.ref, props);
5857

5958
component.instance = instance;
6059

src/TippySingleton.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import {
1010
export default function TippySingleton({
1111
children,
1212
className,
13-
plugins,
1413
enabled = true,
1514
ignoreAttributes = true,
1615
...restOfNativeProps
@@ -27,7 +26,7 @@ export default function TippySingleton({
2726

2827
const deps = [children.length];
2928

30-
useSingletonCreate(component, props, plugins, enabled, deps);
29+
useSingletonCreate(component, props, enabled, deps);
3130
useSingletonUpdate(component, props, enabled);
3231
useUpdateClassName(component, className, deps);
3332

src/hooks.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import {
77

88
export function useSingleton({
99
className,
10-
plugins,
1110
enabled = true,
1211
ignoreAttributes = true,
1312
...restOfNativeProps
@@ -25,7 +24,7 @@ export function useSingleton({
2524

2625
const deps = [component.instances.length];
2726

28-
useSingletonCreate(component, props, plugins, enabled, deps);
27+
useSingletonCreate(component, props, enabled, deps);
2928
useSingletonUpdate(component, props, enabled);
3029
useUpdateClassName(component, className, deps);
3130

src/util-hooks.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ export function useInstance(initialValue) {
3131
return ref.current;
3232
}
3333

34-
export function useSingletonCreate(component, props, plugins, enabled, deps) {
34+
export function useSingletonCreate(component, props, enabled, deps) {
3535
useIsomorphicLayoutEffect(() => {
3636
const {instances} = component;
37-
const instance = createSingleton(instances, props, plugins);
37+
const instance = createSingleton(instances, props);
3838

3939
component.instance = instance;
4040

0 commit comments

Comments
 (0)