Last active
July 11, 2017 21:27
-
-
Save dguo/7114c4feb70a890424ea8c4006c1d39c to your computer and use it in GitHub Desktop.
Hacky codeshift to use React's prop-types package
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://facebook.github.io/react/blog/2017/04/07/react-v15.5.0.html#migrating-from-react.proptypes | |
# I didn't feel like downloading their codeshift. | |
# | |
# in all files in current directory, replace: | |
# import React, {Component, PropTypes} from 'react'; | |
# | |
# with: | |
# import React, {Component} from 'react'; | |
# import PropTypes from 'prop-types'; | |
perl -pi -e "s/import React, \{Component, PropTypes\} from 'react';/import React, \{Component\} from 'react';\nimport PropTypes from 'prop-types';/g;" * |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment