Skip to content

Instantly share code, notes, and snippets.

@jbardon
Last active February 15, 2018 15:00
Show Gist options
  • Save jbardon/98b4a440054aed7ecf5192750bb2274c to your computer and use it in GitHub Desktop.
Save jbardon/98b4a440054aed7ecf5192750bb2274c to your computer and use it in GitHub Desktop.
// Using JS with React.createElement
React.createElement('form', null,
React.createElement('div', {'className': 'form-group'},
React.createElement('label', {'htmlFor': 'email'}, 'Email address'),
React.createElement('input', {'type': 'email', 'id': 'email', 'className': 'form-control'}),
),
React.createElement('button', {'type': 'submit', 'className': 'btn btn-primary'}, 'Submit')
)
// Using JSX
<form>
<div className="form-group">
<label htmlFor="email">Email address</label>
<input type="email" id="email" className="form-control"/>
</div>
<button type="submit" className="btn btn-primary">Submit</button>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment