Skip to content

Commit

Permalink
fix: create/remove springs when useSprings length argument is changed
Browse files Browse the repository at this point in the history
  • Loading branch information
aleclarson committed May 3, 2020
1 parent 0208040 commit 43e8ef5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/core/src/useSprings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,6 @@ export function useSprings(
): any {
const propsFn = is.fun(props) && props

if (propsFn && arguments.length < 3) {
deps = [] // Skip updates after first render.
}

// The "ref" prop is taken from the props of the first spring only.
// The ref is assumed to *never* change after the first render.
let ref: RefObject<SpringHandle> | undefined
Expand Down Expand Up @@ -109,7 +105,7 @@ export function useSprings(
}
}
}
}, deps)
}, (deps || []).concat(length))

const api = useMemo(
(): SpringHandle => ({
Expand Down

0 comments on commit 43e8ef5

Please sign in to comment.