export types or interfaces from another files

Open
#504 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
react, typescript

Research direction

Start by reproducing the issue with the file1 and file2 examples, then trace how react-docgen extracts component and type information from imported interfaces. Determine the expected representation for nested interfaces and their implementations; the work is done when the requested exported type information is available from the generated library output.

Written by the indexing model from the issue text.

Description

file1

import * as React from 'react'
export interface interface1{
name: string
type?: string
}
export class Component1 extends React.Component<IconProps> {}

file2

import * as React from 'react'
import {interface1} from './file1'
export interface interface2{
value: string
type?: interface1
}

export class Component2 extends React.Component<IconProps> {}

the problem I have is that I have nested types and I can't get the types from the library only it give me the names of it .

is there any way to do this ?
I wonder also if I can export interfaces or types from the file not only the component if I can do this I can map unique name to its implementation.

Dominant language
TypeScript
Stars
3.8k
Forks
316
Avg merge
3h 28m
Merged PRs (30d)
6

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from reactjs/react-docgen

All issues in reactjs/react-docgen

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.