Hacker News new | past | comments | ask | show | jobs | submit login

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'))



Good 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.




Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: