mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-17 05:58:41 -09:00
Doc: Add onDecorated reference and fix component hierarchy (#1711)
* Doc: Add TermGroup in component hierarchy * Doc: Add SplitPane in component hierarchy * Doc: Add onDecorated reference
This commit is contained in:
parent
eeaf4be151
commit
e57b8691f7
1 changed files with 26 additions and 4 deletions
|
|
@ -833,7 +833,7 @@
|
||||||
extend <code>Hyper</code> is that of its underlying open
|
extend <code>Hyper</code> is that of its underlying open
|
||||||
source libraries.</p>
|
source libraries.</p>
|
||||||
|
|
||||||
<p>Your module has to expose at least one of these methods:.</p>
|
<p>Your module has to expose at least one of these methods:</p>
|
||||||
|
|
||||||
<table class="api">
|
<table class="api">
|
||||||
<thead>
|
<thead>
|
||||||
|
|
@ -1243,7 +1243,16 @@
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</Header>
|
</Header>
|
||||||
<Terms>
|
<Terms>
|
||||||
<Term /> ...
|
<TermGroup>
|
||||||
|
<SplitPane>
|
||||||
|
<TermGroup>
|
||||||
|
<Term /> ...
|
||||||
|
</TermGroup>
|
||||||
|
<TermGroup>
|
||||||
|
<Term /> ...
|
||||||
|
</TermGroup>
|
||||||
|
</TermGroup>
|
||||||
|
</SplitPane>
|
||||||
</Terms>
|
</Terms>
|
||||||
<Notifications>
|
<Notifications>
|
||||||
<Notification /> ...
|
<Notification /> ...
|
||||||
|
|
@ -1292,9 +1301,14 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
|
<p>Your higher order component can supply a <code>onDecorated</code>
|
||||||
|
property to the decorated component to get a reference to its instance.</p>
|
||||||
|
|
||||||
<p>We encourage you to maintain compatibility with other decorators.
|
<p>We encourage you to maintain compatibility with other decorators.
|
||||||
Since many can be set, don't assume that yours is the only one.
|
Since many can be set, don't assume that yours is the only one.<p>
|
||||||
For example, if you're passing children, compose potential existing
|
|
||||||
|
<p>For example, if you're passing children, compose potential existing
|
||||||
values:</p>
|
values:</p>
|
||||||
|
|
||||||
<pre><code>render () {
|
<pre><code>render () {
|
||||||
|
|
@ -1303,6 +1317,14 @@
|
||||||
return <Tab {...this.props} customChildren={customChildren} />
|
return <Tab {...this.props} customChildren={customChildren} />
|
||||||
}</code></pre>
|
}</code></pre>
|
||||||
|
|
||||||
|
<p>Or if you use <code>onDecorated</code> property</p>
|
||||||
|
<pre><code>onDecorated (term) {
|
||||||
|
this.term = term;
|
||||||
|
if (this.props.onDecorated) {
|
||||||
|
this.props.onDecorated(term);
|
||||||
|
}
|
||||||
|
}</code></pre>
|
||||||
|
|
||||||
|
|
||||||
<h3 id="actions-and-effects"><a href="#actions-and-effects">Actions and Effects</a></h3>
|
<h3 id="actions-and-effects"><a href="#actions-and-effects">Actions and Effects</a></h3>
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue