diff --git a/babel.config.js b/babel.config.js index 19646cbe..7175faeb 100644 --- a/babel.config.js +++ b/babel.config.js @@ -1,6 +1,6 @@ module.exports = { presets: [ - ['@babel/preset-env', { targets: { node: 'current' } }], + ['@babel/preset-env', { targets: '> 3%, not dead' }], '@babel/preset-typescript', '@babel/preset-react', ], diff --git a/src/inputs/AddressInput/index.tsx b/src/inputs/AddressInput/index.tsx index b5c64b44..42ecd1c1 100644 --- a/src/inputs/AddressInput/index.tsx +++ b/src/inputs/AddressInput/index.tsx @@ -143,7 +143,12 @@ function AddressInput({ // when user switch the network we update the address state useEffect(() => { - updateAddressState(inputRef.current?.value); + // Because the `address` is going to change after we call `updateAddressState` + // To avoid calling `updateAddressState` twice, we check the value and the current address + const inputValue = inputRef.current?.value; + if (inputValue !== address) { + updateAddressState(inputRef.current?.value); + } }, [networkPrefix, address, updateAddressState]); // when user types we update the address state diff --git a/webpack.config.js b/webpack.config.js index 9fea02cd..77da6380 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -62,4 +62,7 @@ module.exports = { fs: 'empty', child_process: 'empty', }, + optimization: { + minimize: false, + }, };