plotly / dash-component-boilerplate

Get started creating your own Dash components here.
276 stars 184 forks source link

cannot import external libraries #42

Closed qubolino closed 6 years ago

qubolino commented 6 years ago

i am confronted to an unsolved problem when I want to import external react libs (e.g. material-ui among others). it works well with npm run start (or webpack-serve ./webpack.serve.config.js -hot) but not with npm run build:all (or venv/bin/python usage.py) as it cannot find _react.default.createContext();.

debugging the webpack-serve version (which works) i can see that the function is in react.development.js:1266

while with venv/bin/python usage.py i have the following stacktrace:

    at eval (FormControlContext.js?f516:15)
    at Object../node_modules/@material-ui/core/FormControl/FormControlContext.js (enter_triggered_text_input.dev.js?v=0.0.1&m=1543579949:241)
    at __webpack_require__ (enter_triggered_text_input.dev.js?v=0.0.1&m=1543579949:21)
    at eval (InputBase.js?f12e:34)
    at Object../node_modules/@material-ui/core/InputBase/InputBase.js (enter_triggered_text_input.dev.js?v=0.0.1&m=1543579949:301)
    at __webpack_require__ (enter_triggered_text_input.dev.js?v=0.0.1&m=1543579949:21)
    at eval (index.js?26dc:15)
    at Object../node_modules/@material-ui/core/InputBase/index.js (enter_triggered_text_input.dev.js?v=0.0.1&m=1543579949:325)
    at __webpack_require__ (enter_triggered_text_input.dev.js?v=0.0.1&m=1543579949:21)
    at eval (Input.js?3722:22)

Originally posted by @qubolino in https://github.com/plotly/dash-docs/issues/194#issuecomment-443241827

T4rk1n commented 6 years ago

Material-ui only works with react 16, we are still on react 15. We are upgrading it for dash 1.0.0: https://github.com/plotly/dash/issues/469

qubolino commented 6 years ago

thank you for your answer. i understand better now.

do you have an approximate ETA for dash 1.0.0? or an update allowing dash_renderer._set_react_version('16.3.3')

superior57 commented 4 years ago

Not good