React Router/4/Move Hoc To Global Scope
Codemod verified
Official codemod published by a verified account. Learn more.
migration
Moves HOC calls to the global scope
Example
Before
<Router history={browserHistory}><Switch><Routepath='/'render={(props) => (<Routeexactpath='/a'component={HOC(PageComponent)}/>)}/></Switch></Router>;
After
const HOCPageComponent = HOC(PageComponent);<Router history={browserHistory}><Switch><Routepath='/'render={(props) => (<Routeexactpath='/a'component={HOCPageComponent}/>)}/></Switch></Router>;
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community