✊🏿 Black Lives Matter. Please consider donating to Black Girls Code today.
🧬 Learn how to build RNA-Seq data apps with Python & Dash. Register for the May 20 Webinar!

React FunctionComponent in Dash

I have several React functional components (i.e. written in TypeScript and derived from FunctionComponent). Is there a way to integrate these into dash without having to write a class wrapper to supply the setProps method that it seems Dash requires?

Any useful information would be grateful.

Thanks.

1 Like

setProps is just a regular React prop, and so it can be accessed in functional & class components.

The Select component in dash-bootstrap-components is implemented functionally in case it’s helpful to see an example.

1 Like

Thanks, that was very helpful. It looks like I will be creating a wrapper (kind of what I suspected) for the component.

chriddyp,

Thanks, the Select example mentioned later provided this clarity as well. I was confused regarding this function since a React component also has a method called ‘setProps’ (which has been deprecated but still exists). I thought it was this method the documentation was referring to.