Skip to content

Clarify rules for `children` in component invocations

Choose a tag to compare

@davepeck davepeck released this 17 Sep 19:58
· 33 commits to main since this release

children are now treated like all other attributes during component invocation:

  1. If there's an explicit children parameter, we pass in a tuple. If there are no children in the underlying HTML, the tuple will be empty.
  2. If there's a **kwargs parameter, we always include children; the component is free to ignore this key.
  3. If there's no children parameter and no **kwargs, we ignore children in the underlying HTML if there are any.