Skip to content

Commit c606485

Browse files
authored
fix(useRTGTransitionProps): only add transition callbacks if user passed (#99)
1 parent 1bec0d5 commit c606485

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/useRTGTransitionProps.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ export default function useRTGTransitionProps({
6060
return {
6161
...props,
6262
nodeRef,
63-
onEnter: handleEnter,
64-
onEntering: handleEntering,
65-
onEntered: handleEntered,
66-
onExit: handleExit,
67-
onExiting: handleExiting,
68-
onExited: handleExited,
69-
addEndListener: handleAddEndListener,
63+
...(onEnter && { onEnter: handleEnter }),
64+
...(onEntering && { onEntering: handleEntering }),
65+
...(onEntered && { onEntered: handleEntered }),
66+
...(onExit && { onExit: handleExit }),
67+
...(onExiting && { onExiting: handleExiting }),
68+
...(onExited && { onExited: handleExited }),
69+
...(addEndListener && { addEndListener: handleAddEndListener }),
7070
children:
7171
typeof children === 'function'
7272
? (((status: TransitionStatus, innerProps: Record<string, unknown>) =>

0 commit comments

Comments
 (0)