Skip to content

Commit 7d140fc

Browse files
committed
fix: returning an object from enter function
This affects `update` and `leave` too. Closes #1000
1 parent 2d51b84 commit 7d140fc

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/core/src/hooks/useTransition.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ export function useTransition(
175175

176176
// When "to" is a function, it can return (1) an array of "useSpring" props,
177177
// (2) an async function, or (3) an object with any "useSpring" props.
178-
to = is.obj(to) ? inferTo(to) : { to: callProp(to, t.item, i) }
178+
to = callProp(to, t.item, i)
179+
to = inferTo(is.obj(to) ? to : { to })
179180

180181
if (!to.config) {
181182
const config = props.config || defaultProps.config

0 commit comments

Comments
 (0)