-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
275 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"use strict"; | ||
|
||
if (process.env.NODE_ENV === "production") { | ||
module.exports = require("./production.js"); | ||
} else if (process.env.NODE_ENV === "test") { | ||
module.exports = require("./production.js"); | ||
} else if (typeof window === "undefined") { | ||
// this is just server environment | ||
module.exports = require("./production.js"); | ||
} else if (!module.hot) { | ||
module.exports = require("./production.js"); | ||
} else { | ||
console.warn("You seem to import 'react-hot-loader' in your application, but are using react-fast-refresh. You don't need these imports anymore."); | ||
|
||
module.exports = require("./production.js"); | ||
} |
22 changes: 22 additions & 0 deletions
22
packages/crafty-preset-react/react-hot-loader/production.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
|
||
export function AppContainer(e) { | ||
return React.Children.only(e.children); | ||
} | ||
export function hot() { | ||
return function(e) { | ||
return e; | ||
}; | ||
} | ||
export function areComponentsEqual(e, n) { | ||
return e === n; | ||
} | ||
export function setConfig() { | ||
// NOOP | ||
} | ||
export function cold(e) { | ||
return e; | ||
} | ||
export function configureComponent() { | ||
// NOOP | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.