3 ms·
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 Redu
by olalonde 11y ago
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)
- novaleaf 11y agoThe 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.