diff --git a/utils/babel-plugin-js-to-immutable-prop-types.js b/utils/babel-plugin-js-to-immutable-prop-types.js index 1e6f9a2..557b907 100644 --- a/utils/babel-plugin-js-to-immutable-prop-types.js +++ b/utils/babel-plugin-js-to-immutable-prop-types.js @@ -68,6 +68,12 @@ export default function({ types: t }) { path.replaceWith(t.identifier("PropTypes.bool")); }, + VariableDeclaration(path) { + path.insertBefore(t.identifier(`import ImmutablePropTypes from 'react-immutable-proptypes' + import PropTypes from 'prop-types + `)) + }, + Program(path) { path.traverse({ enter(path) { diff --git a/utils/babel-plugin-js-to-prop-types.js b/utils/babel-plugin-js-to-prop-types.js index e330448..2454840 100644 --- a/utils/babel-plugin-js-to-prop-types.js +++ b/utils/babel-plugin-js-to-prop-types.js @@ -76,6 +76,13 @@ export default function({ types: t }) { }); }, + VariableDeclaration(path) { + path.insertBefore(t.identifier( + `import PropTypes from 'prop-types' + `)) + }, + + ObjectExpression(path) { if ( t.isVariableDeclarator(path.parent) ||