Closed volkanunsal closed 5 years ago
Experimenting with this issue further, I'm finding that 'source-map' devtool may be the actual reason for the strange behavior.
config.mode = 'production'
config = Object.assign({}, config, {
devtool: 'source-map',
});
And also this must be true: NODE_ENV=production
Looks like this is a webpack issue.
Version
Tell us which versions you are using:
Expected behaviour
Tell us what should happen
I'm trying to prepare
tcomb-form
for React 16.7 by getting rid ofcomponentWillReceiveProps
. While working on that project, I discovered that Webpack 4's scope hoisting feature causes some strange update behavior. When you update any input field, the entire fieldset (generated by Struct component) gets updated, which causes input fields to lose their focus.The only way I can get around it is by disabling concatenation or disabling ES6 modules, i.e. pregenerating
tcomb-form
code.Steps to reproduce
production
mode in Webpack config (or just setconfig.optimization.concatenateModules = true
, and make sure to add the pluginnew webpack.optimize.ModuleConcatenationPlugin();
)