Acts similar to current API, where first argument is props, second is state. The third argument acts like a bag and contains context
and any other arguments that would have been passed explicitly before plus an functions to update state.
initialState(props, context)
willMount(props, state, {context, reduce, setState})
render(props, state, {context, reduce, setState})
willReceiveProps(props, state, {nextProps, context, reduce, setState})
shouldUpdate(props, state, {nextProps, nextState, context, nextContext})
willUpdate(props, state, {nextProps, nextState, context, nextContext})
didUpdate(props, state, {prevProps, prevState, reduce, setState})
willUnmount(props, state, context)
dillCatch(props, state, {context, reduce, setState})
Similar to ReasonReact's component API (with some obvious differences for things like context
and bits that ReasonReact doesn't support but we likely will need to) where each argument typically is a version of "this" ("self" in Reason land). So the first argument might be "current self" containing props
, state
and context
, the second argument might be "next self" again, containing props
, state
and context
. I made the last argument a bag of functions we can do. If there was only reduce
this argument would likely only be reduce
rather than an object.
initialState({props, context})
willMount({props, state, context}, {reduce, setState})
render({props, state, context}, {reduce, setState})
willReceiveProps(self: {props, state, context}, props, {reduce, setState})
shouldUpdate(self: {props, state, context}, nextSelf: {props, state, context})
willUpdate(self: {props, state, context}, nextSelf: {props, state, context})
didUpdate(lastSelf: {props, state, context}, self: {props, state, context}, {reduce, setState})
willUnmount({props, state, context})
dillCatch({props, state, context}, {reduce, setState})