File tree Expand file tree Collapse file tree 4 files changed +31
-19
lines changed Expand file tree Collapse file tree 4 files changed +31
-19
lines changed Original file line number Diff line number Diff line change 54
54
"react-dom" : " >=15.0.0"
55
55
},
56
56
"dependencies" : {
57
- "create-react-context" : " ^0.2.3" ,
58
57
"dom-helpers" : " ^3.3.1" ,
59
58
"loose-envify" : " ^1.4.0" ,
60
59
"prop-types" : " ^15.6.2" ,
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ import { polyfill } from 'react-lifecycles-compat'
5
5
6
6
import { timeoutsShape } from './utils/PropTypes'
7
7
8
- import { Provider as TransitionGroupContextProvider , withTransitionGroup } from './TransitionGroupContext'
8
+ import { Provider as TransitionGroupContextProvider , withTransitionGroup , transitionGroupContextPropType } from './TransitionGroupContext'
9
9
10
10
export const UNMOUNTED = 'unmounted'
11
11
export const EXITED = 'exited'
@@ -516,9 +516,7 @@ TransitionWithContext.propTypes = {
516
516
517
517
Transition . propTypes = {
518
518
...TransitionWithContext . propTypes ,
519
- transitionGroup : PropTypes . shape ( {
520
- isMounting : PropTypes . bool . isRequired
521
- } ) ,
519
+ transitionGroup : transitionGroupContextPropType ,
522
520
}
523
521
524
522
TransitionWithContext . defaultProps = {
Original file line number Diff line number Diff line change
1
+ import * as PropTypes from 'prop-types'
1
2
import React from 'react'
2
- import createReactContext from 'create-react-context'
3
3
4
- const { Provider, Consumer } = createReactContext ( null )
4
+ const TransitionGroupContext = React . createContext && React . createContext ( null )
5
+
6
+ export const transitionGroupContextPropType = PropTypes . shape ( {
7
+ isMounting : PropTypes . bool . isRequired
8
+ } )
9
+
10
+ const Consumer = ( TransitionGroupContext && TransitionGroupContext . Consumer ) || class Consumer extends React . Component {
11
+ static contextTypes = {
12
+ transitionGroup : PropTypes . object ,
13
+ }
14
+ render ( ) {
15
+ return this . props . children ( this . context . transitionGroup )
16
+ }
17
+ }
18
+
19
+ const Provider = ( TransitionGroupContext && TransitionGroupContext . Provider ) || class Provider extends React . Component {
20
+ static childContextTypes = {
21
+ transitionGroup : transitionGroupContextPropType ,
22
+ }
23
+ static propTypes = {
24
+ value : transitionGroupContextPropType
25
+ }
26
+ getChildContext ( ) {
27
+ return { transitionGroup : this . props . value }
28
+ }
29
+ render ( ) { return this . props . children }
30
+ }
5
31
6
32
export function withTransitionGroup ( ComponentToWrap ) {
7
33
return class WithTransitionGroup extends React . Component {
Original file line number Diff line number Diff line change @@ -3700,13 +3700,6 @@ create-react-class@^15.6.2:
3700
3700
loose-envify "^1.3.1"
3701
3701
object-assign "^4.1.1"
3702
3702
3703
- create-react-context@^0.2.3 :
3704
- version "0.2.3"
3705
- resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.3.tgz#9ec140a6914a22ef04b8b09b7771de89567cb6f3"
3706
- dependencies :
3707
- fbjs "^0.8.0"
3708
- gud "^1.0.0"
3709
-
3710
3703
cross-spawn@5.1.0, cross-spawn@^5.0.1 :
3711
3704
version "5.1.0"
3712
3705
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449"
@@ -5117,7 +5110,7 @@ fb-watchman@^2.0.0:
5117
5110
dependencies :
5118
5111
bser "^2.0.0"
5119
5112
5120
- fbjs@^0.8.0, fbjs@^0.8. 12, fbjs@^0.8.16, fbjs@^0.8.9 :
5113
+ fbjs@^0.8.12, fbjs@^0.8.16, fbjs@^0.8.9 :
5121
5114
version "0.8.17"
5122
5115
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
5123
5116
dependencies :
@@ -5689,10 +5682,6 @@ growly@^1.3.0:
5689
5682
version "1.3.0"
5690
5683
resolved "https://registry.yarnpkg.com/growly/-/growly-1.3.0.tgz#f10748cbe76af964b7c96c93c6bcc28af120c081"
5691
5684
5692
- gud@^1.0.0 :
5693
- version "1.0.0"
5694
- resolved "https://registry.yarnpkg.com/gud/-/gud-1.0.0.tgz#a489581b17e6a70beca9abe3ae57de7a499852c0"
5695
-
5696
5685
gzip-size@3.0.0 :
5697
5686
version "3.0.0"
5698
5687
resolved "https://registry.yarnpkg.com/gzip-size/-/gzip-size-3.0.0.tgz#546188e9bdc337f673772f81660464b389dce520"
You can’t perform that action at this time.
0 commit comments