Reduce the size of final JSX code
Sep 7, 2018 · 1 min read
What do we need?
.babelrc
presets: [
['@babel/react', {pragma: 'h'}]
]webpack.config.js
plugins: [
new webpack.ProvidePlugin({
h: ['react', 'createElement']
})
]And result is


What does this hack do?
It’s simply transforms React.createElement to h function calls.


