Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
23 lines
649 B
Plaintext
23 lines
649 B
Plaintext
import { jsx as _jsx } from "react/jsx-runtime";
|
|
import { isReactServerComponentOrFunction } from 'payload/shared';
|
|
import React from 'react';
|
|
export const WithServerSideProps = ({
|
|
Component,
|
|
serverOnlyProps,
|
|
...rest
|
|
}) => {
|
|
if (Component) {
|
|
const WithServerSideProps = passedProps => {
|
|
const propsWithServerOnlyProps = {
|
|
...passedProps,
|
|
...(isReactServerComponentOrFunction(Component) ? serverOnlyProps ?? {} : {})
|
|
};
|
|
return /*#__PURE__*/_jsx(Component, {
|
|
...propsWithServerOnlyProps
|
|
});
|
|
};
|
|
return WithServerSideProps(rest);
|
|
}
|
|
return null;
|
|
};
|
|
//# sourceMappingURL=index.js.map |