From 6182d2c7f60967a978f2b885e63fab067794b452 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Mon, 6 Aug 2018 15:28:21 -0400
Subject: Pass in typeDefinitionByName so that type declarations also link to
 inner-types and show the popover

---
 packages/react-docs/src/components/documentation.tsx | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

(limited to 'packages/react-docs/src/components/documentation.tsx')

diff --git a/packages/react-docs/src/components/documentation.tsx b/packages/react-docs/src/components/documentation.tsx
index d9a7dcd59..1c32b2e16 100644
--- a/packages/react-docs/src/components/documentation.tsx
+++ b/packages/react-docs/src/components/documentation.tsx
@@ -225,12 +225,16 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
                     key={`type-${customType.name}`}
                     customType={customType}
                     docsInfo={this.props.docsInfo}
+                    typeDefinitionByName={typeDefinitionByName}
                 />
             );
         });
 
         const sortedProperties = _.sortBy(docSection.properties, 'name');
-        const propertyDefs = _.map(sortedProperties, this._renderProperty.bind(this, sectionName));
+        const propertyDefs = _.map(
+            sortedProperties,
+            this._renderProperty.bind(this, sectionName, typeDefinitionByName),
+        );
 
         const sortedMethods = _.sortBy(docSection.methods, 'name');
         const methodDefs = _.map(sortedMethods, method => {
@@ -349,7 +353,11 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
         });
         return <div>{constructorDefs}</div>;
     }
-    private _renderProperty(sectionName: string, property: Property): React.ReactNode {
+    private _renderProperty(
+        sectionName: string,
+        typeDefinitionByName: TypeDefinitionByName,
+        property: Property,
+    ): React.ReactNode {
         return (
             <PropertyBlock
                 key={`property-${property.name}-${property.type.name}`}
@@ -358,6 +366,7 @@ export class Documentation extends React.Component<DocumentationProps, Documenta
                 docsInfo={this.props.docsInfo}
                 sourceUrl={this.props.sourceUrl}
                 selectedVersion={this.props.selectedVersion}
+                typeDefinitionByName={typeDefinitionByName}
             />
         );
     }
-- 
cgit v1.2.3

