An open-source entry in TopGit's GitHub warehouse: reactjs/react-codemod, 4.4k stars, JavaScript. React codemod scripts
Snapshot summary built from the project's own GitHub metadata — there's no written TopGit review yet. The page will update automatically when a full review is published.
WHY NO REVIEW YET
TopGit writes full reviews for the most-starred, most-requested repositories. This page is a snapshot until then — see the READ ME tab for the original README in full.
Updates this.getDOMNode() or this.refs.foo.getDOMNode() calls inside of
React.createClass components to React.findDOMNode(foo). Note that it will
only look at code inside of React.createClass calls and only update calls on
the component instance or its refs. You can use this script to update most calls
to getDOMNode and then manually go through the remaining calls.
npx codemod react/findDOMNode --target <path>
manual-bind-to-arrow
Converts manual function bindings in a class (e.g., this.f = this.f.bind(this)) to arrow property initializer functions (e.g., f = () => {}).
Converts ES6 classes that only have a render method, only have safe properties
(statics and props), and do not have refs to Functional Components.
The wizard will ask for 2 options -
Use arrow functions?: converts to arrow function. Converts to function by default.
Destructure props?: will destructure props in the argument where it is safe to do so.
npx codemod react/pure-component --target <path>
pure-render-mixin
Removes PureRenderMixin and inlines shouldComponentUpdate so that the ES2015
class transform can pick up the React component and turn it into an ES2015
class. NOTE: This currently only works if you are using the master version
(>0.13.1) of React as it is using React.addons.shallowCompare
The wizard will ask to optionally override mixin-name, and look for it
instead of PureRenderMixin. Note that it is not possible to use a
namespaced name for the mixin. mixins: [React.addons.PureRenderMixin] will
not currently work.
React-PropTypes-to-prop-types
Replaces React.PropTypes references with prop-types and adds the appropriate import or require statement. This codemod is intended for React 15.5+.
Updates code for the split of the react and react-dom packages (e.g.,
React.render to ReactDOM.render). It looks for require('react') and
replaces the appropriate property accesses using require('react-dom'). It does
not support ES6 modules or other non-CommonJS systems. We recommend performing
the findDOMNode conversion first.
After running the automated codemod, you may want to run a regex-based
find-and-replace to remove extra whitespace between the added requires, such
as codemod.py -m -d src --extensions js '(var React\s*=\s*require\(.react.\);)\n\n(\s*var ReactDOM)' '\1\n\2' using
https://github.com/facebook/codemod.
React-DOM-to-react-dom-factories
Converts calls like React.DOM.div(...) to React.createElement('div', ...).
Replaces View.propTypes references with ViewPropTypes and adds the appropriate import or require statement. This codemod is intended for ReactNative 44+.
As of Babel 7.9.0, when using runtime: automatic in @babel/preset-react or @babel/plugin-transform-react-jsx, you will not need to explicitly import React for compiling jsx. This codemod removes the redundant import statements. It also converts default imports (import React from 'react') to named imports (e.g. import { useState } from 'react').
The wizard will ask for 1 option -
Destructure namespace imports as well?: If chosen, namespace imports like import * as React will also be converted. By default, it's false, so only default imports (import React) are converted.
How active is development on reactjs/react-codemod?
The most recent commit recorded on reactjs/react-codemod was 7 months ago, based on the GitHub push timestamp. The repository has 297 forks — one of the better signals of community interest.
How many stars does reactjs/react-codemod have?
reactjs/react-codemod has 4.4k GitHub stars — refresh the page for the live number, or check github.com/reactjs/react-codemod. TopGit mirrors GitHub's count but does not claim minute-by-minute accuracy.
Is reactjs/react-codemod open source?
Yes — reactjs/react-codemod ships under the MIT license, which makes its source code freely readable (and, depending on license terms, forkable and reusable). Source: github.com/reactjs/react-codemod.
What is reactjs/react-codemod?
reactjs/react-codemod (reactjs/react-codemod) is a JavaScript project on GitHub. From the project's own README: React codemod scripts
Where do I read more about reactjs/react-codemod?
This TopGit page is a snapshot — the READ ME tab shows the project's own README content (links stripped, images preserved). The GitHub repository at github.com/reactjs/react-codemod is the definitive source.
Read full README in the tab above.
Is react-codemod worth your time?
ChatGPT, Claude and Perplexity can all read this page. Ask one of them what it makes of react-codemod.