I'm using webpack.optimize.UglifyJsPlugin() to minify my React code.
This is my render function
return (
<div id='columnPicker' className='modal fade' tabIndex='-1' role='dialog'>
<div className='modal-dialog modal-sm' role='document'>
<div className='modal-content'>
<div className='modal-header'>
<button type='button' className='close' data-dismiss='modal'>×</button>
<h4 className='modal-title'>Column Picker</h4>
</div>
<div className='modal-body'>
<ul className='list-group'>
{listItems}
</ul>
</div>
<div className='modal-footer'>
<div className='pull-right'>
<button type='button' className='btn btn-sm btn-primary' data-dismiss='modal' onClick={props.onSave}>Save</button>
</div>
<div className='pull-right'>
<button type='button' className='btn btn-link' data-dismiss='modal'>Cancel</button>
</div>
</div>
</div>
</div>
</div>
);
The close button uses × but when it actually renders I see
<button type="button" class="close" data-dismiss="modal">×</button>
If I remove webpack.optimize.UglifyJsPlugin() it renders as one would expect. Does anyone know how to fix this?
Webpack is not the only bundler you could use (there is Browserify), but it has quickly become the bundler of choice for many React developers, and it is featured in more than a few React best practices blog posts and tutorials.
We need its packages for the following reasons: webpack: The main webpack plugin as an engine for its dependents. webpack-cli: To access some webpack commands through CLI like starting dev server, creating production build, etc. webpack-dev-server: A minimal server for client-side development purpose only.
Configuring webpack provides complete control over the development environment, while initializing with Create React App prevents any custom configuration by default.
Specifying the charset in the HTML will preserve the correct character.
Try adding <meta charset="UTF-8"/>
(or whatever charset) to the meta tag on your html file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With