codenamesen / jamming

http://jammmIt.surge.sh
0 stars 0 forks source link

Code formatting suggested #1

Open farishkash opened 6 years ago

farishkash commented 6 years ago

This is opinionated, I follow the airbnb react style guidelines. When you have a jsx component on one line, you can move this to multiple lines to make this easier to read. Taking the code from your TrackList.js for example.

 this.props.tracks.map(track => {
            return <Track track={track} key={track.id} onAdd={this.props.onAdd} onRemove={this.props.onRemove} isRemoval={this.props.isRemoval}/>;
          })

Each prop that is being passed through of the Track can be dropped down to its own line.

{this.props.tracks.map(track => {
          return (
            <Track
              track={track}
              key={track.id}
              onAdd={this.props.onAdd}
              onRemove={this.props.onRemove}
              isRemoval={this.props.isRemoval}
            />
          );
        })}

I feel this is a better practice plus if you plan to build projects to present to others for job interviews I believe this makes a better presentation.

codenamesen commented 6 years ago

Thank you for showing me that, I was not sure where I could break the line.