Add findDOMNode transform

This commit is contained in:
cpojer
2015-03-25 16:11:52 -07:00
parent 328274bbba
commit 20004e94d3
5 changed files with 217 additions and 0 deletions
+11
View File
@@ -11,6 +11,17 @@ APIs.
* Use the `-d` option for a dry-run and use `-p` to print the output
for comparison
### Included Scripts
`findDOMNode.js` 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.
* `react-codemod findDOMNode <file>`
### Recast Options
Options to [recast](https://github.com/benjamn/recast)'s printer can be provided