Codemod verified
Regularly tested and maintained by our engineers and codemod expert community.
migration
by![](https://cdn.sanity.io/images/aho0e32c/production/61b763a05f41a7aea0b3b3265ff0fc83534ef28c-20x21.svg?w=20&fit=max&auto=format)
Codemod
React Router/4/Replace Param Prop
Last update
Jul 24, 2024
Replaces params
prop passed by react-router with match.params
.
Before
const PostEdit = ({ params }) => (<div><h1>Post {params.id}</h1></div>);
After
const PostEdit = ({ match }) => (<div><h1>Post {match.params.id}</h1></div>);
Build custom codemods
Use AI-powered codemod studio and automate undifferentiated tasks for yourself, colleagues or the community