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

throughDirect

PreviousThroughNextthroughArea

Last updated 5 years ago

High Order Component merge the props from default agent (when only one agent in whole area is exists see )

Params

  • areaName: String: Name of the selected area

Examples

Let Agent is declared and one default instance some where in react tree like this:

const Agent = createAdvAgent('myarea')

...
<Agent text='hello'/>
...

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

const MyContainer = ({text}) => (
  <div>
    {text}
  </div>
)

export default throughDirect('myarea')(MyContainer)
direct mapping