docz icon indicating copy to clipboard operation
docz copied to clipboard

PropsTable is not being rendered when my component is in an external package

Open itReverie opened this issue 8 years ago • 2 comments

Bug Report

PropsTable are not being rendered if I use the Button.jsx file on a package (@itreverie/itr-components-basics) but if I use the same code in the Button.jsx file inside the docz project, the table renders correctly.

To Reproduce

  1. Clone the following repo to reproduce the issue. itr-components-lib
  2. Go to /itr-components-lib/src/basics/Button.mdx
  3. If you use import { Button } from '@itreverie/itr-components-basics'. It doesn't render the table but
  4. If you use import Button from './Button' It renders the table correctly. Note: The repo for the external components can be found in itr-components-basics, it is published in npm.

I would expect that if Button.jsx code is the same in my external package or in the file on my docz package the PropsTable should render. I do not understand why the table is not rendered when I use the Button.jsx on the external package.

propstabledocz

itReverie avatar Aug 25 '18 00:08 itReverie

@itReverie it isn’t a problem and yes a limition of lib that we use to render the prop-types. Then you need to use export default to work in docz.

nicholasess avatar Aug 25 '18 01:08 nicholasess

Hello @nicholasess Thanks so much for your response. When you say I need to use "export default" what exactly do you mean. I think I am using export default Button; (as you can see in the image). I am sorry if I am not getting your point and it might be something basic, could you please be more specific?

itReverie avatar Aug 26 '18 01:08 itReverie