> For the complete documentation index, see [llms.txt](https://react-through.js.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://react-through.js.org/api/through.md).

# Through

Render Props based component to receive data in the though-container. It pass props received from the through-agent to a function. The Function as Child Compnent (FaCC) approach is used.

Props from selected agent or whole area if bearingKey (or direct) prop is not specified.

## Props

* `area`: *String*: The name of the area see [Glossary](/glossary.md)
* `bearingKey`: *String|undefined*: define which agent data is selected, or whole area data if undefined
* `direct`: *String|bool|undefined*: same as `bearingKey` but also `boolean` is allowed and `true` is replaced with `default` for [direct mapping](/basics/direct.md)
* `default`|`defaultValue`: *any*: default value passed to the render function if no such agent exists or in initial rendering
* `children`: *function(props|area: Object)*: props from agent selected by `bearingKey` or `direct` or whole area if not specified

## Examples

Let `Agent` is declared and two instanece of it are rendered some where in react tree like this:

```
const Agent = createAdvAgent('myarea', 'id')

...
<Agent id='first' text='hello'/>
<Agent id='second' text='world'/>
...
```

### Render data from each agent separtely

```javascript
<Through area='myarea' direct='first' default={{text: 'loading...'}}>
  { ({id, text}) => <p>{text}</p> }
</Through>
<Through area='myarea' direct='second' default={{text: 'loading...'}}>
  { ({id, text}) => <p>{text}</p> }
</Through>
```

### Render data using whole area

```javascript
<Through area='myarea'>
  {(area) => {
    <div>
      { ( area['first'] || {text: 'loading...'} ).text }
      { ( area['second'] || {text: 'loading...'} ).text }
    </div>
  }
</Through>
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://react-through.js.org/api/through.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
