Skip to content

Commit

Permalink
Removed hack for baobab branch wrapper: preactjs/preact#175
Browse files Browse the repository at this point in the history
  • Loading branch information
slmgc committed Jun 7, 2016
1 parent 4ce4bc4 commit 65a7ccf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"babel-runtime": "5.8.29",
"baobab": "2.3.3",
"bluebird": "3.4.0",
"preact": "5.0.0-beta6",
"preact": "5.0.0-beta9",
"preact-router": "2.0.0",
"superagent": "2.0.0",
"url-pattern": "1.0.1"
Expand Down
12 changes: 3 additions & 9 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,9 @@ import routes from 'common/routes'
const defaultState = getDefaultState()
const tree = new Baobab(defaultState)
const dao = new Dao({actions, defaultState, tree})

// HACK: functional components break lyfecycle methods,
// using a class-based component to fix this.
// https://github.com/developit/preact/issues/175
const Root = root(tree, class extends Component {
render() {
return <DaoController dao={dao}>{routes}</DaoController>
}
})
const Root = root(tree, () =>
<DaoController dao={dao}>{routes}</DaoController>
)

function init() {
const appRoot = document.getElementById('root')
Expand Down

0 comments on commit 65a7ccf

Please sign in to comment.