Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/React/Basic.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var React = require('react');
exports.react_ = function(spec) {
return React.createClass({
getInitialState: function() {
return spec.initialState;
return spec.initialState(this.props);
},
render: function() {
var this_ = this;
Expand Down
4 changes: 2 additions & 2 deletions src/React/Basic.purs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import React.Basic.Types as React.Basic.Types

foreign import react_
:: forall props state
. { initialState :: state
. { initialState :: props -> state
, render :: Fn3 props state (state -> Eff (react :: ReactFX) Unit) JSX
}
-> ReactComponent props
Expand All @@ -30,7 +30,7 @@ foreign import react_
-- | module (and re-exported here).
react
:: forall props state
. { initialState :: state
. { initialState :: props -> state
, render :: props -> state -> (state -> Eff (react :: ReactFX) Unit) -> JSX
}
-> ReactComponent props
Expand Down