Skip to content

Latest commit

 

History

History
11 lines (9 loc) · 429 Bytes

07.function-as-children.md

File metadata and controls

11 lines (9 loc) · 429 Bytes

Function As Children

Using a function as children isn’t inherently useful.

<div>
  { () => "hello world!" }
</div>

However, it can be used in component authoring for some serious power. This technique is commonly referred to as render callbacks.

This is a powerful technique used by libraries like ReactMotion. When applied, rendering logic can be kept in the owner component, instead of being delegated.