Last active
February 15, 2018 15:00
-
-
Save jbardon/98b4a440054aed7ecf5192750bb2274c to your computer and use it in GitHub Desktop.
#4 - React and Virtual DOM (https://medium.com/keepitlazy/intro-to-react-and-virtual-dom-f2bd1eda2feb)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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