No, you cannot use a stream type as a type in childContextTypes
. The reason is that childContextTypes
checked at runtime, and stream types have no representation at runtime. Therefore, the "types" in childContextTypes
must be values ββ- in particular, the values ββprovided by the prop-types npm package.
Using MyType
in your example is actually a syntax error: MyType
appears at the position of the property value of the object, which should be a value, not a type.
source share