Skip to content

Commit d144045

Browse files
author
Sunil Pai
authored
add React-DOM-to-react-dom-factories to cli/readme (#233)
fixes #192
1 parent 17eab6a commit d144045

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ npx react-codemod react-to-react-dom <path>
116116
React\s*=\s*require\(.react.\);)\n\n(\s*var ReactDOM)' '\1\n\2'` using
117117
https://github.com/facebook/codemod.
118118

119+
#### `React-DOM-to-react-dom-factories`
120+
121+
Converts calls like `React.DOM.div(...)` to `React.createElement('div', ...)`.
122+
123+
```sh
124+
npx react-codemod React-DOM-to-react-dom-factories <path>
125+
```
126+
127+
Converts
128+
119129
#### `ReactNative-View-propTypes`
120130

121131
Replaces `View.propTypes` references with `ViewPropTypes` and adds the appropriate `import` or `require` statement. This codemod is intended for ReactNative 44+.

bin/cli.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,11 @@ const TRANSFORMER_INQUIRER_CHOICES = [
146146
'pure-render-mixin: Removes PureRenderMixin and inlines shouldComponentUpdate',
147147
value: 'pure-render-mixin'
148148
},
149-
// todo - React-DOM-to-react-dom-factories
149+
{
150+
name:
151+
'React-DOM-to-react-dom-factories: Converts React.DOM.<element>(...) to React.createElement(element, ...)',
152+
value: 'React-DOM-to-react-dom-factories'
153+
},
150154
{
151155
name:
152156
'react-to-react-dom: Updates code for the split of the react and react-dom packages',

0 commit comments

Comments
 (0)