packages/cli,dev-utils: add react hot loading support

This commit is contained in:
Patrik Oldsberg
2020-05-16 16:07:18 +02:00
parent 3643faf3d4
commit 90aee3b1aa
5 changed files with 39 additions and 12 deletions
+3 -2
View File
@@ -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);