React JS
React JS
React JS
Mendel Rosenblum
Component #1 Babel
Webpack
Component #2 Babel Output
Bundle.js
...
Component #N Babel
};
export default ReactAppView;
Doesn't work!
let greeting;
const en = "Hello"; const sp = <b>Hola</b>;
let {useSpanish} = this.prop;
if (useSpanish) {greeting = sp} else {greeting = en};
<div>{greeting}</div>
function MyComponent(props) {
return <div>My name is {props.name}</div>;
}
Or using destructuring...
function MyComponent({name}) {
return <div>My name is {name}</div>;
}