Skip to content

useDynamicImport doesn't resolve computed types #21

@benaiahbarango

Description

@benaiahbarango

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 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions