#1565·docz

Props not rendering when using the es11 optional chaining feature

Author: gmonteCreated Sep 1, 2020Updated Oct 3, 2022

Bug Report

When I use the object?.key inside my component code, the Props table doesn't render. And when I change to object.key the Props component render successfully my prop-types.

I tried add the corresponding babel plugin on my gatsby-node.js, but this not work.

javascript
exports.onCreateBabelConfig = ({ actions }) => {
  actions.setBabelPlugin({
    name:  '@babel/plugin-proposal-optional-chaining'
  })
}

To Reproduce

Use the optional chaining feature from es11 inside your React component.

Expected behavior

That and other es11 was enable by default with Creact React App. The Props component need render the prop-types of components that use the es11 features supported by CRA.

Environment

  • docz version: [2.3.1]
  • OS: [OSX 10.15.4]
  • Node/npm version: [Node 12/npm 6]