Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

useDynamicImport doesn't resolve computed types #21

Open
bambie1 opened this issue Feb 28, 2024 · 0 comments
Open

useDynamicImport doesn't resolve computed types #21

bambie1 opened this issue Feb 28, 2024 · 0 comments

Comments

@bambie1
Copy link

bambie1 commented Feb 28, 2024

Hi 馃憢

When using useDynamicImport in my Prop table, it only returns the exact string value of the prop type from my interface

Example Code

type Icon = 'search' | 'home';

interface Props { 
  icon?: Icon;
}

Expected result

Based on what I get on https://react-docgen.dev/playground

"props": {
  "icon": {
    "type": {
      "name": "union",
      "raw": "'search' | 'home'",
      "elements": [
        {
          "name": "literal",
          "value": "'search'"
        },
        {
          "name": "literal",
          "value": "'home'"
        }
      ]
    } 
  }
}

Actual Result

"props": {
  "icon": {
    "type": {
      "name": "Icon", 
    } 
  }
}

Is there a way to get the desired outcome? I'm happy to attempt putting up a PR if I could get pointers on how to run the repo locally

Thanks for the great work 馃檹

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant