diff --git a/website/package.json b/website/package.json index 840186050..afab3d1bc 100644 --- a/website/package.json +++ b/website/package.json @@ -24,7 +24,7 @@ "mkdirp": "^0.5.1", "optimist": "0.6.0", "react": "~0.13.0", - "react-docgen": "^2.9.0", + "react-docgen": "3.0.0-beta2", "react-page-middleware": "0.4.1", "remove-markdown": "^0.1.0", "request": "^2.69.0", diff --git a/website/server/extractDocs.js b/website/server/extractDocs.js index 0dcce20e3..a6f0258b5 100644 --- a/website/server/extractDocs.js +++ b/website/server/extractDocs.js @@ -286,6 +286,15 @@ function getViewPropTypes() { // The alternative would be to duplicate more of the parsing logic here. function viewPropTypesConversionHandler(documentation, astPath) { const builders = recast.types.builders; + + // This is broken because babylon@7 and estree introduced SpreadElement, and ast-types has not been updated to support it + // (we are broken by react-docgen broken by recast broken by ast-types) + astPath.get('properties').value.forEach(n => { + if (n.type === 'SpreadElement') { + n.type = 'SpreadProperty'; + } + }); + const FauxView = builders.classDeclaration( builders.identifier('View'), builders.classBody(