Skip to content

Commit 5eb3d33

Browse files
committed
fix: useTrail "reverse" prop
The "attach" prop must be false when no controller should be attached to. Instead, it was undefined, so it was ignored by the diffing algorithm. This meant that when `reverse` turned false from true, the last controller stayed attached to the 2nd-to-last controller when it should have been the "leader of the pack".
1 parent de448b7 commit 5eb3d33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/useTrail.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const useTrail = (length, props) => {
3333
return {
3434
...props,
3535
config: callProp(props.config || updateProps.config, i),
36-
attach: attachController && (() => attachController),
36+
attach: !!attachController && (() => attachController),
3737
}
3838
}),
3939
[length, updateProps.config]

0 commit comments

Comments
 (0)