react-hot-loader

Cannot use React.lazy with Material UI icons

旧城冷巷雨未停 提交于 2021-02-07 20:35:04
问题 as I have quite a lot of icons in many places in my app, I want to use code splitting for them. I have created helper component to do that: import React, { FunctionComponent, Suspense } from 'react'; interface LazyMuiIconProps { name: string; } export const LazyMuiIcon: FunctionComponent<LazyMuiIconProps> = ({ name }) => { console.log(name); const IconElement = React.lazy(() => import(`@material-ui/icons/${name}`)); // const IconElement = React.lazy(() => import(`@material-ui/icons/Home`));

Cannot use React.lazy with Material UI icons

泄露秘密 提交于 2021-02-07 20:32:53
问题 as I have quite a lot of icons in many places in my app, I want to use code splitting for them. I have created helper component to do that: import React, { FunctionComponent, Suspense } from 'react'; interface LazyMuiIconProps { name: string; } export const LazyMuiIcon: FunctionComponent<LazyMuiIconProps> = ({ name }) => { console.log(name); const IconElement = React.lazy(() => import(`@material-ui/icons/${name}`)); // const IconElement = React.lazy(() => import(`@material-ui/icons/Home`));

React Hot loader 3 with webpack-dev

£可爱£侵袭症+ 提交于 2020-01-03 03:11:36
问题 I'm trying to use hot-react-loader in my project. So I changed some files to work with this but I get an error when I edit a component. Warning: React.createElement: type should not be null, undefined, boolean, or number. It should be a string (for DOM elements) or a ReactClass (for composite components). [HMR] Cannot apply update. Need to do a full reload! what am I doing wrong? webpack.config.dev.js var webpack = require('webpack'); var path = require('path'); // Questo il plugin di webpack

React-hot-loader: react-🔥-dom patch is not detected

隐身守侯 提交于 2019-12-31 11:10:56
问题 I updated some npm packages in my Gatsby project and now I'm seeing this warning in console: React-hot-loader: react-🔥-dom patch is not detected. React 16.6+ features may not work. However, when I look into the source code, there is a comment: // Actually everything works... What does this warning actually mean? Is this something I should fix or just let it be? 回答1: Per my comment above, it's looking like react-hot-loader wants the @hot-loader/react-dom package instead of standard react-dom :

React-hot-loader: react-🔥-dom patch is not detected

半世苍凉 提交于 2019-12-31 11:10:19
问题 I updated some npm packages in my Gatsby project and now I'm seeing this warning in console: React-hot-loader: react-🔥-dom patch is not detected. React 16.6+ features may not work. However, when I look into the source code, there is a comment: // Actually everything works... What does this warning actually mean? Is this something I should fix or just let it be? 回答1: Per my comment above, it's looking like react-hot-loader wants the @hot-loader/react-dom package instead of standard react-dom :

Cannot resolve module 'react-dom'

三世轮回 提交于 2019-12-30 00:27:07
问题 I've seen few posts related to this type of error. But couldn't resolve in mine. My package.json: "react": "~0.14.7", "webpack": "^1.12.13", "react-hot-loader": "^3.0.0-beta.6", . . I'm getting following error on webpack: ERROR in ./public/src/main.js Module not found: Error: Cannot resolve module 'react-dom' in C:\Users\react-example\public\src @ ./public/src/main.js 19:16-36 But in the cmd line when I did npm -v react-dom I get 3.10.10. react-dom is there. But I wonder why it still gives

Can't make react-hot-loader and webpack-dev-server work with react-router

你说的曾经没有我的故事 提交于 2019-12-23 09:17:06
问题 I'm trying to use react-hot-loader with webpack-dev-server and react-router , but when I try to access localhost:3000/ I get : Cannot GET / Of course, it works when I try to access localhost:8000/. I tried to follow react-hot-boilerplate, without success. Here's my code: server.js const http = require('http'); const express = require('express'); const consolidate = require('consolidate'); const bodyParser = require('body-parser'); const routes = require('./routes'); const app = express(); app

Enable single page app react hot reload webpack

≯℡__Kan透↙ 提交于 2019-12-19 19:49:23
问题 I have some problems setting up a single page react app using react router with the webpackdevserver. If I use browserhistory webpack has some problems when entering a nested route url (/client/view for example). This could be solved adding apiFallback but hot reload does still have a problem. It tries to load the hot-update.json file from the deep url (/client/view/hot-update.json) which does not exist and therefor fails and reloads the page. How can i tell hotreload to always load the hot

Cannot resolve module 'webpack/hot/emitter' while using hot reloader

一个人想着一个人 提交于 2019-12-11 01:58:27
问题 I am trying to implement react-hot-loader in my existing application. I followed the tutorial, and used the boilerplate file from this link as suggested in the tutorial. Then, when I start the node server using yarn start , I get the following error: ERROR in (webpack)-dev-server/client?http://0.0.0.0:3000 Module not found: Error: Cannot resolve module 'webpack/hot/emitter' in /Users/Rai/Documents/github/sarvahitey-core/client/node_modules/webpack-dev-server/client @ (webpack)-dev-server

React hot reload not working with webpack 4

断了今生、忘了曾经 提交于 2019-12-10 16:48:18
问题 React hot reload is not working. In webpack entry, I have following code. entry: { home: [ 'webpack-dev-server/client?http://0.0.0.0:8000', 'webpack/hot/dev-server', // add "only-dev-server" prevents reload on syntax errors path.join(__dirname, 'app/home-styles.js') ], main: [ 'babel-polyfill', path.join(__dirname, 'app/styles.js'), path.join(__dirname, 'app/vendor.js'), path.join(__dirname, 'app/index.js') ] }, and in dev-server I have hot = true; and i have below code for wrapping Provider