MrBlenny / react-flow-chart

🌊 A flexible, stateless, declarative flow chart library for react.
https://mrblenny.github.io/react-flow-chart/index.html
MIT License
1.48k stars 306 forks source link

Using plainJS for custom Node component #176

Closed josephtey closed 4 years ago

josephtey commented 4 years ago

I need to create a custom 'Node' component for my flowchart using plain-js (no Typescript). I tried creating a new Node component using CustomNode.tsx as a reference, without importing any interfaces. However, the Node component requires certain typescript wrappers (defined by interfaces) for event listeners, and dragging functionality - hence, deleting all the interfaces (in CustomNode.tsx) to use plain JS ultimately failed to work.

Is is possible to use plain JS to create a custom Node component without losing any core functionality (e.g. dragging, etc)? How can this be achieved?

eprice122 commented 4 years ago

You can accomplish this with styled components (see: #113). Check out #68 if you need to do more than this.