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

What language is this? I'm using es6 and most of my components just look like this:

  export default ({ name }) => (
    <div>hello {name}</div>
  )
With Redux connect:

  const SomeComponent = ({ name }) => (
    <div>hello {name}</div>
  )

  export default connect(s => ({
    name: s.user.name
  }))(SomeComponent)



The code I wrote is Typescript (ES6 with typings), I am using the ES6 class style React Components.

you are using the lambda style components which is fine for simple stuff but for heavier stuff the class-style components are needed. also you are not passing the reducer actions, etc.

Still, what you are showing in your simple example looks pretty similar to the amount of boilerplate I'm seeing with Redux, so it looks like there's not really an easier way.




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

Search: