You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
370 B
15 lines
370 B
var name = Math.random() > 0.5 ? 'Jane' : 'John';
|
|
var HELLO_COMPONENT = `
|
|
class HelloMessage extends React.Component {
|
|
render() {
|
|
return <div>Hello {this.props.name}</div>;
|
|
}
|
|
}
|
|
|
|
ReactDOM.render(<HelloMessage name="${name}" />, mountNode);
|
|
`.trim();
|
|
|
|
ReactDOM.render(
|
|
<ReactPlayground codeText={HELLO_COMPONENT} />,
|
|
document.getElementById('helloExample')
|
|
);
|
|
|