File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -2,29 +2,10 @@ import React from "react";
2
2
import PropTypes from "prop-types" ;
3
3
import warning from "warning" ;
4
4
5
- const valueTypes = {
6
- string : PropTypes . string ,
7
- number : PropTypes . number ,
8
- function : PropTypes . func ,
9
- boolean : PropTypes . bool
10
- } ;
11
-
12
- // TODO: This could probably be improved.
13
- function getPropType ( value ) {
14
- const type = typeof value ;
15
-
16
- if ( type === "object" ) {
17
- return Array . isArray ( value ) ? PropTypes . array : PropTypes . object ;
18
- }
19
-
20
- return valueTypes [ type ] || PropTypes . any ;
21
- }
22
-
23
5
// TODO: Swap this out for Symbol once we don't need a shim for it.
24
6
let uid = 1 ;
25
7
26
8
function createContext ( defaultValue ) {
27
- const valueType = getPropType ( defaultValue ) ;
28
9
const channel = uid ++ ;
29
10
30
11
/**
@@ -54,7 +35,7 @@ function createContext(defaultValue) {
54
35
55
36
static propTypes = {
56
37
children : PropTypes . node ,
57
- value : valueType
38
+ value : PropTypes . any
58
39
} ;
59
40
60
41
static defaultProps = {
You can’t perform that action at this time.
0 commit comments