docz icon indicating copy to clipboard operation
docz copied to clipboard

Props not rendering when using the es11 optional chaining feature

Open gmonte opened this issue 3 years ago • 7 comments

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.

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]

gmonte avatar Sep 01 '20 04:09 gmonte

Same bug here. With optional chaining, the <Props /> render disappeared.

nanxiaobei avatar Dec 12 '20 23:12 nanxiaobei

It was a problem with current version react-docgen. It's failing to parse the optional chain operator due to a babel change, and they fixed it in prior versions.

🙏 Please upgrade, because optional chaining is everywhere in my projects. It make alot of expressions cleaner 👍

DDinenno avatar Feb 10 '21 13:02 DDinenno

Same bug here. Will you be fixing this ?

NightFox7 avatar Sep 26 '22 16:09 NightFox7

This probably will be fixed in the newest version :)

pedronauck avatar Sep 27 '22 08:09 pedronauck

@pedronauck thanks for the response. Is the new version available for testing ? If not, do you have a release date in mind ?

NightFox7 avatar Sep 27 '22 09:09 NightFox7

Hi @NightFox7, I'm confident I will release it in the next couple of months (final November is the deadline). I'm almost done with the main features, just working to improve the basic template and create automated tests for the project.

pedronauck avatar Oct 03 '22 23:10 pedronauck

Some cool new feature that it will include is the ability to support more than one framework together :)

pedronauck avatar Oct 03 '22 23:10 pedronauck