Use case
Framework
Owner
React Router/6/UseHistory To UseNavigate
This codemod migrates
useHistorytouseNavigatein React Router codebases. It replacesuseHistoryimports and updates all instances ofhistory.push,history.replace,go,goBack, andgoForwardto align with theuseNavigateAPI.React Router/6/Switch To Routes
This codemod updates
Switchcomponents toRoutesin React Router, in line with React Router v6 and newer. It also adjusts the imports, replacingSwitchwithRoutesinreact-router-domimport statements.React Router/6/Migrate StaticRouter Import
This codemod updates imports of
StaticRouterto use thereact-router-dom/serverpackage instead ofreact-router-dom, in line with updated React Router requirements.React Router/6/Seperate Link State Prop
This codemod simplifies the
Linkcomponent by transforming itstoprop from an object with apathnameto a string. It removes the unnecessary object wrapper around thepathname, maintaining thestateprop as is.React Router/6/Replace UseRouteMatchWithUseMatch
This codemod updates
useRouteMatchcalls to the neweruseMatchfunction inreact-router-dom. It also adjusts any arguments passed touseRouteMatch, changingstricttoendandsensitivetocaseSensitive. Additionally, it ensures that imports are updated to reflect the removal ofuseRouteMatch.React Router/6/Reorder Matchpath Args
This codemod reorders the arguments in the
matchPathfunction calls. It switches the position of the string path and the second callback argument, improving consistency and readability.React Router/6/Remove ActiveStyleprops
This codemod updates
NavLinkcomponents that use separatestyleandactiveStyleprops to the modernisActivefunction inreact-router-dom. It simplifies the logic by combining the two props into a singlestyleprop with conditional styling.React Router/6/Update Relative Links
This codemod modernizes
RouteandLinkcomponents in React Router by:- Removing the deprecated
exactprop fromRoute. - Updating
Routeto use theelementprop. - Rewriting dynamic
LinkandRoutepaths that use template literals like${match.url}and${match.path}.
- Removing the deprecated
React Router/5.1/Redirect To Navigate
This codemod updates deprecated
Redirectcomponents fromreact-router-domto the modernNavigateAPI. It also updates the imports by replacingRedirectwithNavigate.React Router/6/React Router Config To Use Routes
This codemod helps update code that uses
react-router-configto the modernuseRoutesAPI fromreact-router-dom. It removesrenderRoutesfrom imports and replaces it withuseRoutes. Manual adjustments might be required after running the codemod, especially if other customizations exist in your routing logic.React Router/6/Navlink Exact To End
This codemod replaces the deprecated
exactprop inNavLinkwith the modernendprop. React Router v6 and beyond useendto indicate that the path should match exactly, making this a necessary update for compatibility with newer versions.React Router/5.1/Component Render To Children
This codemod transforms
Routecomponents usingrenderandcomponentprops into JSX with nested children.Ethers/6/Contracts/Other Method Operations
This codemod transforms some of the other method operations that are present in Contracts class of ethers.
Ethers/6/Contracts/Ambiguous Methods
In v5, in the case of an ambiguous method, it was necessary to look up a method by its canonical normalized signature. In v6 the signature does not need to be normalized and the Typed API provides a cleaner way to access the desired method.
Ethers/6/Utilities
This codemod does tranformation based on changes in the utils in ethers.js
Ethers/6/Importing
This codemod helps in tranformation, related to some import packages.
Ethers/6/Providers
In addition to all the
ethers.providers.*being moved toethers.*, the biggest change developers need to keep in mind is that Web3Provider (which historically was used to wrap link-web3 providers) is now called BrowserProvider which is designed to wrap EIP-1193 providers, which is the standard that both modern Web3.js and injected providers offer.Ethers/Big Numbers
This codemod migrates BigNumber in v5 to BigInt in v6 in ethers.js library. It also changes the syntax for addition, and checking equality according to v6.