@@ -28,9 +28,9 @@ import React.Basic.Types as React.Basic.Types
28
28
react
29
29
:: forall props state fx
30
30
. { displayName :: String
31
- , initialState :: state
32
- , receiveProps :: props -> state -> (SetState state fx ) -> Eff (react :: ReactFX | fx ) Unit
33
- , render :: props -> state -> (SetState state fx ) -> JSX
31
+ , initialState :: { | state }
32
+ , receiveProps :: props -> { | state } -> (SetState state fx ) -> Eff (react :: ReactFX | fx ) Unit
33
+ , render :: props -> { | state } -> (SetState state fx ) -> JSX
34
34
}
35
35
-> ReactComponent props
36
36
react { displayName, initialState, receiveProps, render } =
@@ -54,13 +54,13 @@ stateless
54
54
stateless { displayName, render } =
55
55
react
56
56
{ displayName
57
- , initialState: unit
57
+ , initialState: {}
58
58
, receiveProps: \_ _ _ -> pure unit
59
59
, render: \props _ _ -> render props
60
60
}
61
61
62
62
-- | SetState uses an update function to modify the current state.
63
- type SetState state fx = (state -> state ) -> Eff (react :: ReactFX | fx ) Unit
63
+ type SetState state fx = ({ | state } -> { | state } ) -> Eff (react :: ReactFX | fx ) Unit
64
64
65
65
-- | Create a `JSX` node from a React component, by providing the props.
66
66
createElement
@@ -94,9 +94,9 @@ fragmentKeyed = runFn2 fragmentKeyed_
94
94
foreign import component_
95
95
:: forall props state fx
96
96
. { displayName :: String
97
- , initialState :: state
98
- , receiveProps :: EffFn3 (react :: ReactFX | fx ) props state (SetState state fx ) Unit
99
- , render :: Fn3 props state (SetState state fx ) JSX
97
+ , initialState :: { | state }
98
+ , receiveProps :: EffFn3 (react :: ReactFX | fx ) props { | state } (SetState state fx ) Unit
99
+ , render :: Fn3 props { | state } (SetState state fx ) JSX
100
100
}
101
101
-> ReactComponent props
102
102
0 commit comments