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

Import Type definition for custom Node ? #103

Open
jonlepage opened this issue Dec 21, 2020 · 1 comment
Open

Import Type definition for custom Node ? #103

jonlepage opened this issue Dec 21, 2020 · 1 comment

Comments

@jonlepage
Copy link

jonlepage commented Dec 21, 2020

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
Diagram seem not export Node type !
image

Actually the only hack i found and make success to get Intelisence types, is by add a default parameter

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

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

maybe allow something like this for avoid <Any>?

/** custom renderer for Diagram Node
 * @param {Diagram['Node']} props - Current Node
*/
const CustomNode = (props) => { ...
@ChesterSim
Copy link

Maybe you can try import { Node } from 'beautiful-react-diagrams/@types/DiagramSchema';?

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

No branches or pull requests

2 participants