From 70766dcd2ad4c56e4729779384a5cf1f6991733f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Goetz?= Date: Sun, 12 Aug 2018 08:28:00 +0200 Subject: [PATCH] Fix crash on name --- src/index.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/index.js b/src/index.js index 892ec67..1879d19 100644 --- a/src/index.js +++ b/src/index.js @@ -43,6 +43,13 @@ function injectReactDocgenInfo(path, state, code, t) { docgenResults.forEach(function(docgenResult, index) { let exportName = docgenResult.actualName; + + // If the result doesn't have an actualName, + // it's probably on arrow functions. + if (!exportName) { + return; + } + const docNode = buildObjectExpression(docgenResult, t); const docgenInfo = t.expressionStatement( t.assignmentExpression(