reactjs / reactjs/react-docgen

export types or interfaces from another files

オープン
#504 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
TypeScript
スター
3.8k
フォーク
316
平均マージ
5時間 7分
マージ済み PR(30日)
4

説明

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.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず file1 と file2 の例で問題を再現し、次に react-docgen がインポートされたインターフェースからコンポーネント情報と型情報をどのように抽出するかを追跡します。ネストされたインターフェースとその実装に対して期待される表現を特定します。要求されたエクスポート済みの型情報が生成されたライブラリ出力から利用できるようになれば、作業は完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react, typescript
領域
documentation, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。