reactjs - PropType validation is throwing an error because of RoutingContext -
i'm getting following error props validating:
warning: failed proptype: required prop assettype not specified in assetmanagementshow. check render method of routingcontext.
warning: failed proptype: required prop assettypes not specified in assetmanagementtransactionsfecher. check render method of routingcontext. routes this:
<route path='asset_management' component={assetmanagementcontainer} > <indexroute component={assetmanagementindex} /> <route path=':name' component={assetmanagementtransactionsfetcher}> <indexroute component={assetmanagementshow} /> <route path=':transactionkey' component={transactionsshow} /> </route> </route> i'm getting error when trying render assetmanagementshow (and transactionsshow). i'm getting error props of both assetmanagementtransactionsfetcher , assetmanagementshow.
the assetmanagementcontainer fetches data , renders child route using react.cloneelement. assetmanagementtransactionsfetcher same - fetches data , renders child route new props.
i think problem arises. when pass props child route using react.cloneelement, child route not validate proptypes properly.
i'm running react-router v1.0.3
this way that prop type validation works cloneelement – validation done on element creation, rather on mount.
more details , references available here: https://github.com/rackt/react-router/blob/master/upgrade-guides/v1.0.0.md#routehandler.
Comments
Post a Comment