Created
February 23, 2019 09:29
-
-
Save amirulabu/978516d69c6cfd2746f6f54ff03f2676 to your computer and use it in GitHub Desktop.
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
const props = { | |
className: 'container', | |
children: 'Hello World' | |
} | |
const element = <div className={props.className} children={props.children} /> | |
const element1 = <div {...props}/> | |
const element2 = <div className="my-class" {...props}/> | |
const element3 = <div {...props} children="Hello Mirul" /> | |
const element4 = <div {...props}>Hello Mirul</div> | |
const element5 = React.createElement('div', { | |
id: 'greeting', | |
className: 'active', | |
children: 'Hello ' + user.name, | |
}) | |
const Message = (props)=> <div>{props.msg}</div> | |
const element6 = <Message msg='Hello World' /> | |
const Message2 = (props) => <div>{props.children}</div> | |
const element7 = <Message2>Hello World</Message2> | |
const rootElement = document.getElementByID('root') | |
const element8 = (<div>This is a test</div>) | |
ReactDOM.render(element, rootElement) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
copy paste this at https://babeljs.io/repl to find out how JSX translate to JS