Skip to content

Instantly share code, notes, and snippets.

@exogen
Created July 19, 2019 22:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exogen/50153ec35affe3f85924ea8adfab6c33 to your computer and use it in GitHub Desktop.
Save exogen/50153ec35affe3f85924ea8adfab6c33 to your computer and use it in GitHub Desktop.
// This is based on some transpiled Babel code causing the `default` export
// to be undefined. If you look at the ultimate code that ends up in the Next.js
// bundle, `Object` method references are changed to strange `@babel/runtime`
// references, which seems to potentially cause a circular import (?) resulting
// in it being undefined.
exports.__esModule = true;
exports.default = DebugProvider;
exports.DebugContext = void 0;
var _react = _interopRequireWildcard(require("react"));
function _interopRequireWildcard(obj) {
if (obj && obj.__esModule) {
return obj;
} else {
var newObj = {};
if (obj != null) {
for (var key in obj) {
if (Object.prototype.hasOwnProperty.call(obj, key)) {
var desc =
Object.defineProperty && Object.getOwnPropertyDescriptor
? Object.getOwnPropertyDescriptor(obj, key)
: {};
if (desc.get || desc.set) {
Object.defineProperty(newObj, key, desc);
} else {
newObj[key] = obj[key];
}
}
}
}
newObj.default = obj;
return newObj;
}
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
const DebugContext = _react.default.createContext();
exports.DebugContext = DebugContext;
function DebugProvider({ children }) {
const state = {};
return _react.default.createElement(
DebugContext.Provider,
{
value: state
},
children
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment