Skip to content

Commit a221046

Browse files
committed
fix: have TransitionFn return a fragment
1 parent 4404979 commit a221046

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

packages/core/src/hooks/useTransition.tsx

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -268,20 +268,23 @@ export function useTransition(
268268
reset ? void 0 : deps
269269
)
270270

271-
const renderTransitions: TransitionFn = render =>
272-
transitions.map((t, i) => {
273-
const { springs } = changes.get(t) || t.ctrl
274-
const elem: any = render({ ...springs }, t.item, t, i)
275-
return elem && elem.type ? (
276-
<elem.type
277-
{...elem.props}
278-
key={is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id}
279-
ref={elem.ref}
280-
/>
281-
) : (
282-
elem
283-
)
284-
})
271+
const renderTransitions: TransitionFn = render => (
272+
<>
273+
{transitions.map((t, i) => {
274+
const { springs } = changes.get(t) || t.ctrl
275+
const elem: any = render({ ...springs }, t.item, t, i)
276+
return elem && elem.type ? (
277+
<elem.type
278+
{...elem.props}
279+
key={is.str(t.key) || is.num(t.key) ? t.key : t.ctrl.id}
280+
ref={elem.ref}
281+
/>
282+
) : (
283+
elem
284+
)
285+
})}
286+
</>
287+
)
285288

286289
return arguments.length == 3
287290
? ([renderTransitions, api.update, api.stop] as const)

0 commit comments

Comments
 (0)