flume
flume copied to clipboard
Can't use custom portType
Hello, I'm trying to add a custom node for having a curve editor directly on my graph. The problem is I'm not able to use a custom port control like this:
config.addPortType({
type: "curve",
name: "curve",
label: "Curve",
color: Colors.pink,
controls: [
Controls.custom({
name: "curve",
label: "Curve",
render: function (data, onChange){
<Curve />
}
})
]
})
I have this error when I try to use my node with my custom port TypeError: render is not a function Directly from the Flume node_module, does someone knows how to solve this ?
Thanks everyone !
Hey Cyril, do you by chance have a public repo where I could take a look at this for you in context? One possible problem right off the bat is your render function isn't actually returning any JSX. If you want to implicitly return you'd want to use an arrow function like this:
render: (data, onChange) => (<Curve />)