Render props with async components
A component receives its children as written, like in React: one child is passed as it is, several children as an array, and without children there is no children prop at all. So a single function child works as a render prop: the component loads the data, and the caller decides how it looks.
The same <Jokes> loader is used twice below with different markup. Reload for new jokes.
As a list
- There are 10 kinds of people in this world. - Those who understand binary, those who don't, and those who weren't expecting a base 3 joke.
- Where do programmers like to hang out? - The Foo Bar.
- A user interface is like a joke. - If you have to explain it then it is not that good.