File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change 33 "version" : " 0.1.3" ,
44 "description" : " Polyfill for the proposed React context API" ,
55 "main" : " lib/index.js" ,
6+ "typings" : " src/index.d.ts" ,
67 "repository" : " https://github.com/thejameskyle/create-react-context" ,
78 "author" : " James Kyle <me@thejameskyle.com>" ,
89 "license" : " MIT" ,
Original file line number Diff line number Diff line change 1- // PRs welcome
1+ import * as React from 'react' ;
2+
3+ export default function createReactContext < T > ( defaultValue : T ) : Context < T > ;
4+
5+ export type Context < T > = {
6+ Provider : React . ComponentClass < ProviderProps < T > > ;
7+ Consumer : React . ComponentClass < ConsumerProps < T > > ;
8+ } ;
9+
10+ export type ProviderProps < T > = {
11+ value : T ;
12+ children ?: React . ReactNode ;
13+ } ;
14+
15+ export type ConsumerProps < T > = {
16+ children : ( value : T ) => React . ReactNode ;
17+ } ;
You can’t perform that action at this time.
0 commit comments