import React , { SFC , ComponentType } from 'react' ; import { RouteContext } from '../types' ; import RouteNode from '../render/RouteNode' ; function routeNode < P > ( nodeName ) { return function ( BaseComponent ) : SFC < P > { function RouteNodeWrapper ( props ) { return ( < RouteNode nodeName = { nodeName } > { routeContext => ( < BaseComponent { ... props } { ... routeContext } / > ) } < /RouteNode>); } return RouteNodeWrapper ; } ; } export default routeNode ;