These are the properties your component definition may override
with specific implementations. None are required to be overridden, unless
an overridden function interacts with state, in which case initialState
is required (the compiler enforces this). While you can use state and
dispatch actions without defining update, doing so doesn't make much sense
and will emit a warning.

initialState

The component's starting state.

Avoid mirroring prop values in state.

update

All state updates go through update.

update is called when send is used to dispatch an action.

State changes are described using StateUpdate. Only Update and UpdateAndSideEffects will cause rerenders and a call to didUpdate.

Side effects requested are only invoked after any corrosponding state update has completed its render cycle and the changes have been applied. This means it is safe to interact with the DOM in a side effect, for example.

render

Takes a current snapshot of the component (Self) and converts it to renderable JSX.

didMount

The React component's componentDidMount lifecycle. Useful for initiating an action on first mount, such as fetching data from a server.

shouldUpdate

Can be useful for performance optimizations. Rarely necessary.

didUpdate

The React component's componentDidUpdate lifecycle. Rarely necessary.

willUnmount

The React component's componentWillUnmount lifecycle. Any subscriptions or timers created in didMount or didUpdate should be disposed of here.

The component spec is generally not exported from your component
module and this type is rarely used explicitly. make will validate whether
your component's internal types line up.

The resulting component spec is usually given the simplified Component type:

component :: Component Props
component = createComponent "Counter"

This function should be used at the module level and considered side effecting.
This is because React uses referential equality when deciding whether a new
JSX tree is a valid update or if it needs to be replaced entirely
(expensive and clears component state lower in the tree).

Note: A specific type for the props in Component props should always be chosen at this point.
It's technically possible to declare the component with forall props. Component props
but doing so is unsafe. Leaving the prop type open allows the use of a single Component
definition in multiple React-Basic components that may have different prop types. Because
component lifecycles are managed by React, it becomes possible for incompatible prop values to
be passed by React into lifecycle functions.

Note: A Component is not a valid React component by itself. If you would like to use
a React-Basic component from JavaScript, use toReactComponent.

Note: Never define a component with
a less specific type for props than its associated ComponentSpec and make
calls, as this can lead to unsafe interactions with React's lifecycle management.

For the curious: This is the "class" React will use to render and
identify the component. It receives the ComponentSpec as a prop and knows
how to defer behavior to it. It requires very specific props and is not useful by
itself from JavaScript. For JavaScript interop, see toReactComponent.

Unsafe escape hatch to the underlying component instance (this in the JavaScript React paradigm). Avoid as much as possible, but it's still frequently better than rewriting an entire component in JavaScript.

Note: The only difference between a stateless React-Basic component and
a plain props -> JSX function is the presense of the component name
in React's dev tools and error stacks. It's just a conceptual boundary.
If this isn't important simply write a props -> JSX function.

Convert a React-Basic ComponentSpec to a JavaScript-friendly React component.
This function should only be used for JS interop and not normal React-Basic usage.

Note: Like createComponent, toReactComponent is side effecting in that
it creates a "class" React will see as unique each time it's called. Lift
any usage up to the module level, usage in render or any other function,
and applying any type classes to the props.