Skip to content

Instantly share code, notes, and snippets.

@ratbeard
Created April 12, 2018 16:44
Show Gist options
  • Select an option

  • Save ratbeard/78f3fdebd2c2b107b2791475cb3acf45 to your computer and use it in GitHub Desktop.

Select an option

Save ratbeard/78f3fdebd2c2b107b2791475cb3acf45 to your computer and use it in GitHub Desktop.
RFC 89: Self closing tag placement when attributes broken across lines
# Option 1:
<input
id="adminName"
placeholder="Library Name"
required
type="text"
value={this.state.adminName}
onChange={this.setAdminName} />
# Option 2:
<input
id="adminName"
placeholder="Library Name"
required
type="text"
value={this.state.adminName}
onChange={this.setAdminName}
/>
@ratbeard
Copy link
Author

!vote Option 2

  • easier to pick out where the element ends
  • easier to add a new attribute to the end, which seems fairly common

@bradgreens
Copy link

2️⃣

Use it for 2 or more properties? Maybe 3?

@lancebecker
Copy link

option two, but I think I agree with brad, over 3 props else it can run inline

@jpiemeisl
Copy link

!vote Option 1

  • I know how to read

@bradgreens
Copy link

So does Trump.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment