3 ms·
I think the argument could be even more compelling without the es6-isms: function Header(props) { return <h1>{props.text}</h1>; } function Main() {
by aboodman 9y ago
I think the argument could be even more compelling without the es6-isms:
function Header(props) {
return <h1>{props.text}</h1>;
}
function Main() {
return <Header text={new Date()}/>;
}
ReactDom.render(<Main />, document.querySelector('#app'))
- mlsarecmg 9y agoGood call. Although the timestamp would have been impossible in Vue since templates don't have scope, they couldn't access imports. One would have to jump through another hoop and inject/duplicate the function into a template method.