mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-18 14:38:40 -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
|
||||
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">
|
||||
<thead>
|
||||
|
|
@ -1243,7 +1243,16 @@
|
|||
</Tabs>
|
||||
</Header>
|
||||
<Terms>
|
||||
<Term /> ...
|
||||
<TermGroup>
|
||||
<SplitPane>
|
||||
<TermGroup>
|
||||
<Term /> ...
|
||||
</TermGroup>
|
||||
<TermGroup>
|
||||
<Term /> ...
|
||||
</TermGroup>
|
||||
</TermGroup>
|
||||
</SplitPane>
|
||||
</Terms>
|
||||
<Notifications>
|
||||
<Notification /> ...
|
||||
|
|
@ -1292,9 +1301,14 @@
|
|||
</tbody>
|
||||
</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.
|
||||
Since many can be set, don't assume that yours is the only one.
|
||||
For example, if you're passing children, compose potential existing
|
||||
Since many can be set, don't assume that yours is the only one.<p>
|
||||
|
||||
<p>For example, if you're passing children, compose potential existing
|
||||
values:</p>
|
||||
|
||||
<pre><code>render () {
|
||||
|
|
@ -1303,6 +1317,14 @@
|
|||
return <Tab {...this.props} customChildren={customChildren} />
|
||||
}</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>
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue