From e57b8691f7620d7c260948a028c6b19e184cd238 Mon Sep 17 00:00:00 2001 From: CHaBou Date: Sat, 13 May 2017 16:57:41 +0200 Subject: [PATCH] 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 --- website/index.html | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/website/index.html b/website/index.html index 4582508c..82128f50 100644 --- a/website/index.html +++ b/website/index.html @@ -833,7 +833,7 @@ extend Hyper is that of its underlying open source libraries.

-

Your module has to expose at least one of these methods:.

+

Your module has to expose at least one of these methods:

@@ -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 @@
+ +

Your higher order component can supply a onDecorated + property to the decorated component to get a reference to its instance.

+

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.

+ +

For example, if you're passing children, compose potential existing values:

render () {
@@ -1303,6 +1317,14 @@
   return <Tab {...this.props} customChildren={customChildren} />
 }
+

Or if you use onDecorated property

+
onDecorated (term) {
+  this.term = term;
+  if (this.props.onDecorated) {
+    this.props.onDecorated(term);
+  }
+}
+

Actions and Effects