Skip to content

Commit

Permalink
add more auto-options
Browse files Browse the repository at this point in the history
  • Loading branch information
theKashey committed Dec 13, 2018
1 parent 8affde9 commit ca92718
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
11 changes: 7 additions & 4 deletions src/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ const configuration = {
// Log level
logLevel: 'error',

// Allows using SFC without changes. leading to some components not updated
pureSFC: false,
// Allows using SFC without changes
pureSFC: true,

// keep render method unpatched, moving sideEffect to componentDidUpdate
pureRender: false,
Expand All @@ -14,7 +14,7 @@ const configuration = {
// Disable "hot-replacement-render"
disableHotRenderer: false,

// Disable "hot-replacement-render" when injection into react-dom are made
// Disable "hot-replacement-render" when injection into react-dom is made
disableHotRendererWhenInjected: false,

// Hook on babel component register.
Expand All @@ -23,9 +23,12 @@ const configuration = {
// Hook on React renders for a first time component
onComponentCreate: false,

// flag to completely disable RHL for SFC
// flag to completely disable RHL for SFC. Probably don't use it without dom patch made.
ignoreSFC: false,

// ignoreSFC when injection into react-dom is made
ignoreSFCWhenInjected: true,

// flag to completely disable RHL for Components
ignoreComponents: false,

Expand Down
9 changes: 6 additions & 3 deletions src/reactHotLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,17 @@ const reactHotLoader = {
configuration.disableHotRenderer =
configuration.disableHotRendererWhenInjected

configuration.ignoreSFC = configuration.ignoreSFCWhenInjected

reactHotLoader.IS_REACT_MERGE_ENABLED = true
console.info(
'React-Hot-Loader: react-🔥-dom patch detected. You may use all the features.',
)
} else {
console.warn(
'React-Hot-Loader: react-🔥-dom patch is not detected. React 16.6+ features may not work.',
)
// Actually everything works...
// console.warn(
// 'React-Hot-Loader: react-🔥-dom patch is not detected. React 16.6+ features may not work.',
// )
}
/* eslint-enable */
if (!React.createElement.isPatchedByReactHotLoader) {
Expand Down

0 comments on commit ca92718

Please sign in to comment.