Initial commit
This commit is contained in:
commit
78f8d225ee
21173 changed files with 2907774 additions and 0 deletions
36
node_modules/next/dist/client/components/metadata/server-inserted-metadata.js
generated
vendored
Normal file
36
node_modules/next/dist/client/components/metadata/server-inserted-metadata.js
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
Object.defineProperty(exports, "ServerInsertMetadata", {
|
||||
enumerable: true,
|
||||
get: function() {
|
||||
return ServerInsertMetadata;
|
||||
}
|
||||
});
|
||||
const _react = require("react");
|
||||
const _serverinsertedmetadatasharedruntime = require("../../../shared/lib/server-inserted-metadata.shared-runtime");
|
||||
// Receives a metadata resolver setter from the context, and will pass the metadata resolving promise to
|
||||
// the context where we gonna use it to resolve the metadata, and render as string to append in <body>.
|
||||
const useServerInsertedMetadata = (metadataResolver)=>{
|
||||
const setMetadataResolver = (0, _react.useContext)(_serverinsertedmetadatasharedruntime.ServerInsertedMetadataContext);
|
||||
if (setMetadataResolver) {
|
||||
setMetadataResolver(metadataResolver);
|
||||
}
|
||||
};
|
||||
function ServerInsertMetadata(param) {
|
||||
let { promise } = param;
|
||||
// Apply use() to the metadata promise to suspend the rendering in SSR.
|
||||
const { metadata } = (0, _react.use)(promise);
|
||||
// Insert metadata into the HTML stream through the `useServerInsertedMetadata`
|
||||
useServerInsertedMetadata(()=>metadata);
|
||||
return null;
|
||||
}
|
||||
|
||||
if ((typeof exports.default === 'function' || (typeof exports.default === 'object' && exports.default !== null)) && typeof exports.default.__esModule === 'undefined') {
|
||||
Object.defineProperty(exports.default, '__esModule', { value: true });
|
||||
Object.assign(exports.default, exports);
|
||||
module.exports = exports.default;
|
||||
}
|
||||
|
||||
//# sourceMappingURL=server-inserted-metadata.js.map
|
||||
Loading…
Add table
Add a link
Reference in a new issue