Skip to content

Commit

Permalink
[#1] - Refactored to annotate a stateless function component with Pro…
Browse files Browse the repository at this point in the history
…psType in parameters.
  • Loading branch information
JimmyLv committed Sep 30, 2016
1 parent 6267a29 commit 204d646
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions src/containers/AppContainer.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { Component } from 'react'
import React from 'react'
import { connect } from 'react-redux'

import './AppContainer.less'
Expand All @@ -13,23 +13,18 @@ type PropsType = {
children: ReactElement
}

@connect(
const AppContainer =
({ musicList, pathname, posts, dispatch, children }: PropsType) => (
<div className="main-app">
<Header {...{ musicList, pathname, posts, dispatch }} />
{children}
</div>
)

export default connect(
({ musicList, articleSummary, routing }) => ({
musicList,
posts: articleSummary.paginator,
pathname: routing.locationBeforeTransitions.pathname
})
)
export default class AppContainer extends Component {
props: PropsType

render() {
const { musicList, pathname, posts, dispatch } = this.props
return (
<div className="main-app">
<Header {...{ musicList, pathname, posts, dispatch }}/>
{this.props.children}
</div>
)
}
}
)(AppContainer)

0 comments on commit 204d646

Please sign in to comment.