react-image-compressor icon indicating copy to clipboard operation
react-image-compressor copied to clipboard

Ternary Operator Issue

Open t2e0j0a4 opened this issue 2 years ago • 0 comments

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.

t2e0j0a4 avatar Nov 13 '22 12:11 t2e0j0a4