Skip to content

Instantly share code, notes, and snippets.

@VaheGrigorian
VaheGrigorian / react-context-ts
Created September 10, 2015 21:54
React context with Typescript
ParentComponent extends React.Component<{}, {}>{
static childContextTypes:React.ValidationMap<any> = {
name: React.PropTypes.string.isRequired
}
constructor(props, context){
super(props, context);
}
getChildContext(){
return {
name: 'Vahe'