packages/cli,dev-utils: add react hot loading support
This commit is contained in:
@@ -41,6 +41,7 @@
|
||||
"@types/node": "^12.0.0",
|
||||
"react": "^16.12.0",
|
||||
"react-dom": "^16.12.0",
|
||||
"react-hot-loader": "^4.12.21",
|
||||
"react-router": "^5.2.0",
|
||||
"react-router-dom": "^5.2.0"
|
||||
},
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { hot } from 'react-hot-loader/root';
|
||||
import React, { FC, ComponentType } from 'react';
|
||||
import ReactDOM from 'react-dom';
|
||||
import { BrowserRouter } from 'react-router-dom';
|
||||
@@ -90,10 +91,10 @@ class DevAppBuilder {
|
||||
}
|
||||
|
||||
/**
|
||||
* Build and render directory to #root element
|
||||
* Build and render directory to #root element, with react hot loading.
|
||||
*/
|
||||
render(): void {
|
||||
const DevApp = this.build();
|
||||
const DevApp = hot(this.build());
|
||||
|
||||
const paths = this.findPluginPaths(this.plugins);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user