Skip to content

[Bug]: declarations and parent objects for props are not populated with TypeScript >= v5.1.3 #483

Open
@Francois-Esquire

Description

@Francois-Esquire

The declarations and parent properties on the docgen property object appear to be missing (thus not filtered by the default method) in later versions of typescript (after v5.0.4). For example, a docgen property object when working as expected:

{
  defaultValue: null,
  description: '',
  name: 'key',
  parent: {
    fileName: '<root>/node_modules/@types/react/index.d.ts',
    name: 'Attributes'
  },
  declarations: [
    {
      fileName: '<root>/node_modules/@types/react/index.d.ts',
      name: 'Attributes'
    }
  ],
  required: false,
  type: { name: 'Key | null | undefined' }
}

compared to:

{
  defaultValue: null,
  description: '',
  name: 'key',
  parent: undefined,
  declarations: [],
  required: false,
  type: { name: 'Key | null | undefined' }
}

After some exploration, (this part of the source code) where the declarations are populated for each property do not seem to be working after v5.1.3. The thread appears to lead to typescript itself (ts.Symbol) has changed.

See previous issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions