react-through
  • README
  • Introduction
    • Motivation
    • Core Concepts
  • Basics
    • Installation and setup
    • Direct Mapping
    • Many Agents
  • Glossary
  • API Reference
    • ThroughProvider
    • createAgent
    • createAdvAgent
    • Through
    • throughDirect
    • throughArea
    • throughContainer
    • Internals
      • Internal Agent Interface
Powered by GitBook
On this page
  • Params
  • Examples
  1. API Reference

throughArea

High Order Component merge the whole area to the wrapped component props

Params

  • areaName: String: Name of the selected area

Examples

Let Agent is declared and two instance are rendered some where in react tree like this:

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

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

Then we can render hello world using HOC throughArea() like this:

const MyContainer = ({first,second}) => (
  <div>
    {first.text} {second.text}
  </div>
)

export default throughArea('myarea')(MyContainer)
PreviousthroughDirectNextthroughContainer

Last updated 5 years ago