Skip to content

Commit f321d80

Browse files
committed
Revert "define Transition props"
This reverts commit 0262f9a.
1 parent 0262f9a commit f321d80

File tree

3 files changed

+6
-22
lines changed

3 files changed

+6
-22
lines changed

packages/@react-spectrum/overlays/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
"@react-types/overlays": "^3.9.0",
4949
"@react-types/shared": "^3.31.0",
5050
"@swc/helpers": "^0.5.0",
51-
"@types/react-transition-group": "^4.4.12",
5251
"react-transition-group": "^4.4.5"
5352
},
5453
"devDependencies": {

packages/@react-spectrum/overlays/src/OpenTransition.tsx

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,14 @@
1010
* governing permissions and limitations under the License.
1111
*/
1212

13-
import React, {ComponentProps, JSX, JSXElementConstructor, ReactElement} from 'react';
14-
import {Transition} from 'react-transition-group';
13+
import React, {JSX, JSXElementConstructor, ReactElement} from 'react';
14+
import {Transition, TransitionProps} from 'react-transition-group';
1515

1616
const OPEN_STATES = {
1717
entering: false,
1818
entered: true
1919
};
2020

21-
type TransitionProps = ComponentProps<typeof Transition<HTMLElement>>
22-
interface OpenTransitionProps extends Omit<TransitionProps, 'children'> {
23-
children: any
24-
}
25-
2621
/**
2722
* Timeout issues adding css animations to enter may be related to
2823
* https://github.com/reactjs/react-transition-group/issues/189 or
@@ -37,16 +32,16 @@ interface OpenTransitionProps extends Omit<TransitionProps, 'children'> {
3732
*/
3833

3934
export function OpenTransition(
40-
props: OpenTransitionProps
41-
): JSX.Element | ReactElement<any, string | JSXElementConstructor<any>>[] {
35+
props: TransitionProps
36+
): JSX.Element | ReactElement<any, string | JSXElementConstructor<any>>[] {
4237
// Do not apply any transition if in chromatic.
4338
if (process.env.CHROMATIC) {
44-
return React.Children.map(props.children, child => child && React.isValidElement(child) && React.cloneElement(child as any, {isOpen: props.in}));
39+
return React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: props.in}));
4540
}
4641

4742
return (
4843
<Transition timeout={{enter: 0, exit: 350}} {...props}>
49-
{(state) => React.Children.map(props.children, child => child && React.isValidElement(child) && React.cloneElement(child as any, {isOpen: !!OPEN_STATES[state]}))}
44+
{(state) => React.Children.map(props.children, child => child && React.cloneElement(child, {isOpen: !!OPEN_STATES[state]}))}
5045
</Transition>
5146
);
5247
}

yarn.lock

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7260,7 +7260,6 @@ __metadata:
72607260
"@react-types/overlays": "npm:^3.9.0"
72617261
"@react-types/shared": "npm:^3.31.0"
72627262
"@swc/helpers": "npm:^0.5.0"
7263-
"@types/react-transition-group": "npm:^4.4.12"
72647263
react-transition-group: "npm:^4.4.5"
72657264
peerDependencies:
72667265
"@react-spectrum/provider": ^3.0.0
@@ -10598,15 +10597,6 @@ __metadata:
1059810597
languageName: node
1059910598
linkType: hard
1060010599

10601-
"@types/react-transition-group@npm:^4.4.12":
10602-
version: 4.4.12
10603-
resolution: "@types/react-transition-group@npm:4.4.12"
10604-
peerDependencies:
10605-
"@types/react": "*"
10606-
checksum: 10c0/0441b8b47c69312c89ec0760ba477ba1a0808a10ceef8dc1c64b1013ed78517332c30f18681b0ec0b53542731f1ed015169fed1d127cc91222638ed955478ec7
10607-
languageName: node
10608-
linkType: hard
10609-
1061010600
"@types/react@npm:19.1.8":
1061110601
version: 19.1.8
1061210602
resolution: "@types/react@npm:19.1.8"

0 commit comments

Comments
 (0)