GithubHelp home page GithubHelp logo

Comments (6)

strothj avatar strothj commented on June 12, 2024

Hello,

Can you upload a minimal reproduction? (You can copy the example project from this repo, add styled-components, and push to a repo).

Out of curiosity, are those components (base button/ button/ primary button) spread across different files? If so, what file contains the props interface?

from react-docgen-typescript-loader.

tobiastimm avatar tobiastimm commented on June 12, 2024

@strothj I've updated the example in my fork.
https://github.com/tobiastimm/react-docgen-typescript-loader/tree/master/packages/react-docgen-typescript-loader-example
Same behaviour

from react-docgen-typescript-loader.

strothj avatar strothj commented on June 12, 2024

Awesome thank you. I will check this out sometime tomorrow

from react-docgen-typescript-loader.

strothj avatar strothj commented on June 12, 2024

Hello,

I've reproduced the issue in Styleguidest as well, which means the issue lies in how react-docgen-typescript is handling the parsing.

image

I've uploaded a test repo with your component so you can open an issue there and have something to reference:
https://github.com/strothj/react-docgen-typescript-loader-styleguidist-test-styled-components

Weird enough, if you change:

const BaseButton: StatelessComponent<ButtonProps> = ({

to

export const BaseButton: StatelessComponent<ButtonProps> = ({

the component gets detected as BaseButton and the props populate correctly. Obviously, you want the name to show up as PrimaryButton.

image

from react-docgen-typescript-loader.

tobiastimm avatar tobiastimm commented on June 12, 2024

@strothj ah okay. Yeah I only want to export PrimaryButton

from react-docgen-typescript-loader.

strothj avatar strothj commented on June 12, 2024

I updated the reference project from #13 (comment). I believe updates from react-docgen-typescript have resolved the issue.

from react-docgen-typescript-loader.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.