Skip to content

Commit 101b0e4

Browse files
committed
Enable transform-react-constant-elements babel on prod
It seems that the issues have been resolved, so this plugin can be used again
1 parent 4207b28 commit 101b0e4

File tree

1 file changed

+4
-9
lines changed
  • packages/babel-preset-react-cy-app

1 file changed

+4
-9
lines changed

packages/babel-preset-react-cy-app/index.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,9 @@ if (env === 'test') {
8181
};
8282

8383
if (env === 'production') {
84-
// Optimization: hoist JSX that never changes out of render()
85-
// Disabled because of issues:
86-
// * https://github.com/facebookincubator/create-react-app/issues/525
87-
// * https://phabricator.babeljs.io/search/query/pCNlnC2xzwzx/
88-
// * https://github.com/babel/babel/issues/4516
89-
// TODO: Enable again when these issues are resolved.
90-
// plugins.push.apply(plugins, [
91-
// require.resolve('babel-plugin-transform-react-constant-elements')
92-
// ]);
84+
plugins.push.apply(plugins, [
85+
// Reduces calls to `React.createElement` by hoisting static components to the top
86+
require.resolve('babel-plugin-transform-react-constant-elements')
87+
]);
9388
}
9489
}

0 commit comments

Comments
 (0)