Component Boilerplate

Hey,

does the Boilerplate also work with the newest coding style of React 16.9.0?
Where classes/components can be defined with “const”?

Yes, the version requirement for React in the boilerplate is ^16.8.6, so if you install now you’ll get 16.9.0.

For what it’s worth, functional components have always been available in React, it’s just that with the addition of hooks in react 16.8 it became possible to use state and other features that previously you had to write classes for.

Hey Sound cool, i had a little code snippet that works fine in react 16.9 on its own, but while running the build for the python component generator it said that component wasnt found.

And another thing, can you give a dash component as a prop the your react component? Dash components are nothing else than react, as to what i have read. When does my dcc.Graph turn into a react component?

it said that component wasnt found.

That sounds less like a syntax / react version error and more like maybe the component wasn’t exported properly? Did you export from the file you defined it in and also from the index file?

And another thing, can you give a dash component as a prop the your react component?

Currently only as the children prop accepts other dash components.

dash-renderer is responsible I believe for constructing the tree of components that you specify with app.layout, but I don’t know how it works well enough to say with any confidence. Maybe one of the dash developers can chime in and explain.

1 Like

Yep Sorry first question was a mistake on my end.

How can i pass the dash component as the prop.children?
Im new to react, sorry :smiley:

Hey, i have managed to get my dash components into react, thx for your help !

1 Like