Default props of React components don't end up in Python class.
See original GitHub issueRelated to #174
Hi @shammamah,
When writing tests for the OncoPrint component, I’ve noticed that the ‘simple app’ launched by Selenium didn’t have the same defaults as those specified in OncoPrint (src/lib/components/OncoPrint.react.js) and as seen in the demo app (tests/dashbio_demos/app_onco_print.py). Specifically, I’m referring to prop showoverview, for which the default value is True (which seems to correspond to using Layout(xaxis=dict(rangeslider={'autorange': True})) in a Plotly plot).
Here’s a screenshot of the ‘simple app’, as used in CI tests:
as opposed to the demo app:

As I dug deeper, I noticed that the OncoPrint class of the dash_bio package did not contain this piece of information (actually, parameter showoverview=Component.UNDEFINED and is optional). More generally, components which result from compiling React components into Python don’t seem to contain any information about default props…
In the demo app, showoverview=True is passed explicitly, it’s not inherited in any way from the OncoPrint component… So, it looks like the whole defaultProps part from React components might be lost in translation when compiling into Python.
Maybe it doesn’t make that much sense to have these defaultProps in the first place?..
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (8 by maintainers)

Top Related StackOverflow Question
Yep, this is the case for my SequenceViewer component at the very least, which is a React component.
Back when I dug the issue, it actually made sense: That ‘default’ value was never actually passed, so it couldn’t end up in an app (simple version) which doesn’t specify it… In this sense, it’s not a bug. What I’ve noticed is that the issue doesn’t arise in other cases only because the ‘default’ values in question happen to coincide with defaults in native plotly.