React Router/4/Replace Param Prop

1.0.1Last update Jul 24, 2024
by@alexbit-codemod
React-router
migration

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

background illustrationGet Started Now