antonioru / antonioru/beautiful-react-diagrams

Import Type definition for custom Node ?

オープン
#103 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
2.7k
フォーク
171
PR マージ指標
30日以内にマージされた PR はありません

説明

hey guys how i import the type for your node in custom render?
I test all what i know but am not able to find a ways !
![image](https://user-images.githubusercontent.com/24865815/102727577-5d516180-42f4-11eb-8adc-9fa6d744ef9e.png)
Diagram seem not export Node type !
![image](https://user-images.githubusercontent.com/24865815/102727676-0c8e3880-42f5-11eb-826a-78a4f3f9b2b8.png)

Actually the only hack i found and make success to get Intelisence types, is by add a default parameter
```js
const CustomNode = (props = createSchema({}).nodes[0]) => {
const { inputs } = props;

```
but am not fan with this ugly way !! , am search a way to add type in documentation
![image](https://user-images.githubusercontent.com/24865815/102727627-b02b1900-42f4-11eb-87eb-5122cbd012ef.png)

Any suggest ?, this React plugin look crazy congrat !
I'm just not a fan to code blinded. :)

maybe allow something like this for avoid ``?
```js
/** custom renderer for Diagram Node
* @param {Diagram['Node']} props - Current Node
*/
const CustomNode = (props) => { ...
```

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

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

評価

この issue はまだ評価されていません。

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

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