flume icon indicating copy to clipboard operation
flume copied to clipboard

Can't use custom portType

Open CyrilDelvalle-Actronika opened this issue 3 years ago • 1 comments

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 !

CyrilDelvalle-Actronika avatar Apr 27 '21 15:04 CyrilDelvalle-Actronika

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 />)

chrisjpatty avatar May 04 '21 21:05 chrisjpatty