Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(@types): improve types of DiagramNode #91

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

kei711
Copy link

@kei711 kei711 commented Dec 4, 2020

Description

  • Fixed argument type of render props in Node

Related Issue

Motivation and Context

How Has This Been Tested?

yarn test-types

Screenshots (if appropriate):

❯ yarn test-types
yarn run v1.22.5
$ npx tsc -p . --noEmit
✨  Done in 3.28s.

kei711 and others added 2 commits December 4, 2020 16:51
Co-authored-by: Keisuke Kan <keisuke_kan@caddi.jp>
Comment on lines 26 to 29
export type NodeRenderProps<P> = Omit<
Node<P>,
'coordinates' | 'disableDrag' | 'inputs' | 'outputs'
> & { inputs: ReactElement<Port>[]; outputs: ReactElement<Port>[] };
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@antonioru
Copy link
Owner

Hello @kei711

thank you very much for your contribution, it looks great... I'm not a TS expert so I ask for the help of @9renpoto on this as he improved the exported types part.

Copy link
Contributor

@9renpoto 9renpoto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM :)

@antonioru thank you review!

@kresli
Copy link

kresli commented Apr 13, 2021

any updates on this?

@kresli
Copy link

kresli commented Apr 13, 2021

actually, I think this is still missing style prop

image

@kresli
Copy link

kresli commented Apr 13, 2021

All works if we change it to

export type NodeRenderProps<P> = Omit<
  Node<P>,
  'coordinates' | 'disableDrag' | 'inputs' | 'outputs'
> & { 
  inputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[]; 
  outputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[] 
};

@kei711
Copy link
Author

kei711 commented Apr 16, 2021

Hi @kresli, thanks for the feedback.
I've committed your suggestion in 57dbbff.

Comment on lines +26 to +32
export type NodeRenderProps<P> = Omit<
Node<P>,
'coordinates' | 'disableDrag' | 'inputs' | 'outputs'
> & {
inputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[];
outputs: ReactElement<Port & HTMLAttributes<HTMLDivElement>>[];
};
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants