From bce97c2543d8f1f4fef3e65086d25ed37977b361 Mon Sep 17 00:00:00 2001
From: Fabio Berger <me@fabioberger.com>
Date: Wed, 11 Apr 2018 17:39:30 +0900
Subject: Add support for displaying default param values

---
 packages/react-docs/src/components/signature.tsx | 2 ++
 1 file changed, 2 insertions(+)

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

diff --git a/packages/react-docs/src/components/signature.tsx b/packages/react-docs/src/components/signature.tsx
index 83fb1e246..1d3c90261 100644
--- a/packages/react-docs/src/components/signature.tsx
+++ b/packages/react-docs/src/components/signature.tsx
@@ -91,6 +91,7 @@ function renderParameters(
 ) {
     const params = _.map(parameters, (p: Parameter) => {
         const isOptional = p.isOptional;
+        const hasDefaultValue = !_.isUndefined(p.defaultValue);
         const type = (
             <Type
                 type={p.type}
@@ -103,6 +104,7 @@ function renderParameters(
             <span key={`param-${p.type}-${p.name}`}>
                 {p.name}
                 {isOptional && '?'}: {type}
+                {hasDefaultValue && ` = ${p.defaultValue}`}
             </span>
         );
     });
-- 
cgit v1.2.3

