Skip to content

Commit 28bfdd4

Browse files
committed
fix: move react-dom notification to AppContainer, fixes #1227
1 parent f036d36 commit 28bfdd4

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

Diff for: src/AppContainer.dev.js

+8
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,14 @@ class AppContainer extends React.Component {
2828
generation: 0,
2929
};
3030

31+
constructor(props) {
32+
super(props);
33+
if (configuration.showReactDomPatchNotification) {
34+
configuration.showReactDomPatchNotification = false;
35+
console.warn('React-Hot-Loader: react-🔥-dom patch is not detected. React 16.6+ features may not work.');
36+
}
37+
}
38+
3139
shouldComponentUpdate(prevProps, prevState) {
3240
// Don't update the component if the state had an error and still has one.
3341
// This allows to break an infinite loop of error -> render -> error -> render

Diff for: src/configuration.js

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const configuration = {
1717
// Disable "hot-replacement-render" when injection into react-dom is made
1818
disableHotRendererWhenInjected: false,
1919

20+
// Controls `react-🔥-dom patch` notification
21+
showReactDomPatchNotification: true,
22+
2023
// Hook on babel component register.
2124
onComponentRegister: false,
2225

Diff for: src/reactHotLoader.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,8 @@ const reactHotLoader = {
106106
configuration.ignoreSFC = configuration.ignoreSFCWhenInjected;
107107

108108
reactHotLoader.IS_REACT_MERGE_ENABLED = true;
109+
configuration.showReactDomPatchNotification = false;
109110
// console.warn('react-🔥-loader activated.');
110-
} else {
111-
// Actually everything works...
112-
console.warn('React-Hot-Loader: react-🔥-dom patch is not detected. React 16.6+ features may not work.');
113111
}
114112
/* eslint-enable */
115113
if (!React.createElement.isPatchedByReactHotLoader) {

0 commit comments

Comments
 (0)