react-image-compressor
react-image-compressor copied to clipboard
Ternary Operator Issue
It's not a major issue but in your component instead of
{this.state.outputFileName ? (
<button
type="button"
className=" btn btn-dark"
onClick={e => this.click(e)}
>
Compress
</button>
) : (
<></>
)}
you can use
{this.state.outputFileName && (
<button
type="button"
className=" btn btn-dark"
onClick={e => this.click(e)}
>
Compress
</button>
)}
Yet both are same functionality , code looks goods without empty fragments . Same issue in some else part of code too.