_app.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", {
  3. value: true
  4. });
  5. Object.defineProperty(exports, "AppInitialProps", {
  6. enumerable: true,
  7. get: function() {
  8. return _utils.AppInitialProps;
  9. }
  10. });
  11. Object.defineProperty(exports, "NextWebVitalsMetric", {
  12. enumerable: true,
  13. get: function() {
  14. return _utils.NextWebVitalsMetric;
  15. }
  16. });
  17. Object.defineProperty(exports, "AppType", {
  18. enumerable: true,
  19. get: function() {
  20. return _utils.AppType;
  21. }
  22. });
  23. exports.default = void 0;
  24. var _async_to_generator = require("@swc/helpers/lib/_async_to_generator.js").default;
  25. var _interop_require_default = require("@swc/helpers/lib/_interop_require_default.js").default;
  26. var _react = _interop_require_default(require("react"));
  27. var _utils = require("../shared/lib/utils");
  28. function appGetInitialProps(_) {
  29. return _appGetInitialProps.apply(this, arguments);
  30. }
  31. function _appGetInitialProps() {
  32. _appGetInitialProps = /**
  33. * `App` component is used for initialize of pages. It allows for overwriting and full control of the `page` initialization.
  34. * This allows for keeping state between navigation, custom error handling, injecting additional data.
  35. */ _async_to_generator(function*({ Component , ctx }) {
  36. const pageProps = yield (0, _utils).loadGetInitialProps(Component, ctx);
  37. return {
  38. pageProps
  39. };
  40. });
  41. return _appGetInitialProps.apply(this, arguments);
  42. }
  43. var _Component;
  44. class App extends (_Component = _react.default.Component) {
  45. render() {
  46. const { Component , pageProps } = this.props;
  47. return /*#__PURE__*/ _react.default.createElement(Component, Object.assign({}, pageProps));
  48. }
  49. }
  50. App.origGetInitialProps = appGetInitialProps;
  51. App.getInitialProps = appGetInitialProps;
  52. exports.default = App;
  53. //# sourceMappingURL=_app.js.map