<!DOCTYPE html>
<html>
<head>
<body>
<div id="root" />
<script src="/bundle.js"></script>
</body>
</head>
</html>
class UserImage extends React.Component {
render() {
return (
<div>
<img src={this.props.userImageUrl} />
</div>
)
}
}
export default graphql(
gql`
query UserImage($userId: UserId) {
user(userId: $userId) {
userImageUrl
}
}
`, {
options: ({ userId }) => ({ variables: { userId }})
}
)(UserImage)
Text
define visitChildren (instance):
children = result of calling the `render` function
For each child in children:
visit(child's Component with the expected props and
context)
define visit (Component):
instance = result of running the component's constructor and
componentWillMount
if instance defines a data requirement function:
Initiate resolving that data requirement
When it resolves:
visitChildren(instance)
else
visitChildren(instance)
Text