Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#65364 [@types/react-transition-group] add …
Browse files Browse the repository at this point in the history
…missing childProps opt param in TransitionChildren type by @steven-brand-dd

* add missing childProps param in TransitionChildren type

* make optional

* respond to comment

* quick fix

* quick fix

* quick fix

* quick fix

* quick fix
  • Loading branch information
steven-brand-dd committed May 4, 2023
1 parent 0503d6b commit 26ec8fa
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions types/react-transition-group/Transition.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component, ReactNode } from 'react';
type RefHandler<
RefElement extends undefined | HTMLElement,
ImplicitRefHandler extends (node: HTMLElement, ...args: any[]) => void,
ExplicitRefHandler extends (...args: any[]) => void
ExplicitRefHandler extends (...args: any[]) => void,
> = {
implicit: ImplicitRefHandler;
explicit: ExplicitRefHandler;
Expand Down Expand Up @@ -135,7 +135,9 @@ interface BaseTransitionProps<RefElement extends undefined | HTMLElement> {
}

export type TransitionStatus = typeof ENTERING | typeof ENTERED | typeof EXITING | typeof EXITED | typeof UNMOUNTED;
export type TransitionChildren = ReactNode | ((status: TransitionStatus) => ReactNode);
export type TransitionChildren =
| ReactNode
| ((status: TransitionStatus, childProps?: Record<string, unknown>) => ReactNode);

export interface TimeoutProps<RefElement extends undefined | HTMLElement> extends BaseTransitionProps<RefElement> {
/**
Expand Down Expand Up @@ -187,7 +189,10 @@ export interface EndListenerProps<Ref extends undefined | HTMLElement> extends B
* - enter defaults to `0`
* - exit defaults to `0`
*/
timeout?: number | { appear?: number | undefined; enter?: number | undefined; exit?: number | undefined } | undefined;
timeout?:
| number
| { appear?: number | undefined; enter?: number | undefined; exit?: number | undefined }
| undefined;
/**
* Add a custom transition end trigger. Called with the transitioning DOM
* node and a done callback. Allows for more fine grained transition end
Expand Down

0 comments on commit 26ec8fa

Please sign in to comment.