Common props
Motivation
Extensibility
/** @namespace Pages/getCommonServerSideProps */
const getCommonServerSideProps = () => ({ props: {} });
/** @namespace <%= server_namespace %> */
const getServerSideProps = () => getCommonServerSideProps();const addStoreNameToCommonProps = async (args, callback) => {
const commonProps = await callback(...args);
return {
props: {
...commonProps.props,
storeName: 'My awesome store'
}
};
};
export default {
'Pages/getCommonServerSideProps': {
function: addStoreNameToCommonProps
}
};Usage
Working with common props
Last updated