After the transformation is done the `withamp-to-config.js` file in the root of your project can be removed.
## v6
### `url-to-withrouter`
Tranforms the deprecated automatically injected `url` property on top level pages to using `withRouter` and the `router` property it injects. Read more here: [err.sh/next.js/url-deprecated](https://err.sh/next.js/url-deprecated)
For example:
```js
// From
importReactfrom'react'
exportdefaultclassextendsReact.Component{
render(){
const{pathname}=this.props.url
return<div>Currentpathname:{pathname}</div>
}
}
```
```js
// To
importReactfrom'react'
import{withRouter}from'next/router'
exportdefaultwithRouter(
classextendsReact.Component{
render(){
const{pathname}=this.props.router
return<div>Currentpathname:{pathname}</div>
}
}
)
```
This is just one case. All the cases that are transformed (and tested) can be found in the [`__testfixtures__` directory](./transforms/__testfixtures__/url-to-withrouter).
#### Usage
Go to your project
```
cd path-to-your-project/
```
Download the codemod:
```
curl -L https://github.com/zeit/next-codemod/archive/master.tar.gz | tar -xz --strip=2 next-codemod-master/transforms/url-to-withrouter.js