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";
22import PropTypes from "prop-types" ;
33import warning from "warning" ;
44
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-
235// TODO: Swap this out for Symbol once we don't need a shim for it.
246let uid = 1 ;
257
268function createContext ( defaultValue ) {
27- const valueType = getPropType ( defaultValue ) ;
289 const channel = uid ++ ;
2910
3011 /**
@@ -54,7 +35,7 @@ function createContext(defaultValue) {
5435
5536 static propTypes = {
5637 children : PropTypes . node ,
57- value : valueType
38+ value : PropTypes . any
5839 } ;
5940
6041 static defaultProps = {
You can’t perform that action at this time.
0 commit comments