Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add codemod for 'React.DOM.div' -> 'React.createElement("div"' #133

Merged
merged 2 commits into from
Apr 20, 2017

Commits on Apr 20, 2017

  1. Add codemod for 'React.DOM.div' -> 'React.createElement("div"'

    Since we are deprecating the 'React.DOM.*' factories,[1] we want to
    provide a codemod so that it's easier for folks to upgrade their code.
    
    This will include an option to use 'React.createFactory' instead of
    'React.createElement' in case there is a use case where that is
    preferred.
    
    There is one use of `React.DOM.*` that I have seen which is not covered
    here - sometimes it has mistakenly been used for Flow typing. In the
    cases I have found it is not proper syntax and doesn't seem like
    something we should cover with this codemod.
    
    [1]: facebook/react#9398
    and facebook/react#8356
    flarnie committed Apr 20, 2017
    Configuration menu
    Copy the full SHA
    26f661f View commit details
    Browse the repository at this point in the history
  2. Restructure codemod to make things more clear

    We want to make sure that only references to `{DOM} = React;` are
    transformed, and not `{DOM} = Foobar;` or anything else. This makes the
    code a bit more clear in that intention.
    flarnie committed Apr 20, 2017
    Configuration menu
    Copy the full SHA
    ccb182f View commit details
    Browse the repository at this point in the history