Open Akuukis opened 5 years ago
It turned out that by removing "react-hot-loader/babel"
plugin from webpack config file, the hot
from import { hot } from 'react-hot-loader/root'
started to work as expected. It now reloads only the last component, maintains state, and doesn't throw any warnings about material-ui components.
The readme suggests that if I'm using babel then I should be using the plugin. Also, the aliasing doesn't seem to have any effect - it can't see a difference, nor see the warning about "react-hot-dom" missing.
Strange. babel plugin
should not work this way. It should not affect anything, especially in this simple case.
Material-ui component Grid throws invariant warning when hot reloading.
keyword: alpha, hooks, hmr, rhl, react, component, grid, v4, invariant
Expected Behavior π€
I expect to hot-reload material-ui components just fine at all newest versions.
Current Behavior π―
RHL looks like working, although throws
Invariant Violation: "Invalid hook call...
warning.Steps to Reproduce πΉ
I can't make codesandbox.io example, because this is related to RHL. Code below:
Steps:
webpack-dev-server --mode development --hot
test.tsx
file edit "change me"Invariant Violation: "Invalid hook call...
warning. Also,test.tsx
file change "Grid" to "div"Invariant Violation: "Invalid hook call...
warning. Alsotest.tsx
file change text again and leave it to "div"Context π¦
I'm trying to setup Material-UI React hook-only app in Typescript.
Your Environment π
Using webpack@4.30.0 with @babel/core@7.4.3 and @babel/preset-typescript@7.3.3 . I'm using only babel to transpile TS code.