A chantastic guide to components
This is a component
A component can compose other components
A component can me bade composeable via the children
prop
This is another component
One component can render another
Options can be passed to components (these are called props)
But props must be accepted and implemented
props can have default values
but these values are not automatically merged with incoming values
merging values must be done manually as well
Control of merging can be delegated via prop callback functions — allowing component consumers to modify defaults
Default resolvers, and formatters can be exported for use by component consumers
to avoid manually clearlisting all valid HTML attributes, use rest and spread syntax for props
This implementation makes it simple to opt out of defaults (where necessary)
children
can be an array
children
can be many types.
So treat children
as opaque
React.children