Skip to content

Instantly share code, notes, and snippets.

@jonsherrard
Last active October 8, 2015 15:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonsherrard/8c148a4fca577b0a943c to your computer and use it in GitHub Desktop.
Save jonsherrard/8c148a4fca577b0a943c to your computer and use it in GitHub Desktop.
How do you format your component props?
// 1
<Modal
isOpen={this.state.showTermsModal}
onRequestClose={this._toggleTerms}
style={this._customStyles}
/>
// 2
<Modal
isOpen={this.state.showTermsModal}
onRequestClose={this._toggleTerms}
style={this._customStyles}/>
// 3
<Modal
isOpen={this.state.showTermsModal}
onRequestClose={this._toggleTerms}
style={this._customStyles}
/>
@alecperkins
Copy link

// 4
<Modal
    isOpen         = { this.state.showTermsModal }
    onRequestClose = { this._toggleTerms }
    style          = { this._customStyles }
/>

or CJSX if an option

<Modal
    isOpen         = @state.showTermsModal
    onRequestClose = @_toggleTerms
    style          = @_customStyles
/>

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