Ratatouille v0.3.0 Ratatouille.Component.Stateless behaviour View Source
Defines the behaviour for a stateless view component.
Unlike stateful components, stateless components cannot define event handlers
or tick behavior. Stateless components define a render/1 function that
renders an Ratatouille.View. The concept is the same as React's functional
components.
While it's possible for stateless components to access global VM state, this is discouraged. They should render a view as a pure function of the given props.
Link to this section Summary
Callbacks
The render/1 callback provides an interface for rendering the component's
view based on the current state
Link to this section Types
Link to this type
props()
View Source
props()
View Source
props() :: term()
props() :: term()
Link to this section Callbacks
Link to this callback
render(props)
View Source
render(props)
View Source
render(props()) :: Ratatouille.Renderer.Element.t()
render(props()) :: Ratatouille.Renderer.Element.t()
The render/1 callback provides an interface for rendering the component's
view based on the current state.