From 4bd499f0e968c15d9cb1fb870e0985fd8b07fcbc Mon Sep 17 00:00:00 2001 From: Roman Hotsiy Date: Sun, 7 Jul 2019 19:43:31 +0300 Subject: [PATCH] fix: hide empty example when it is not defined --- src/components/Fields/FieldDetails.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Fields/FieldDetails.tsx b/src/components/Fields/FieldDetails.tsx index 9626da0e..87bb2363 100644 --- a/src/components/Fields/FieldDetails.tsx +++ b/src/components/Fields/FieldDetails.tsx @@ -33,7 +33,8 @@ export class FieldDetails extends React.PureComponent { if (showExamples) { const label = l('example') + ':'; if (field.in && field.style) { - const serializedValue = serializeParameterValue(field, example); + const serializedValue = + example !== undefined ? serializeParameterValue(field, example) : undefined; exampleField = ; } else { exampleField = ;