The Page component calls these methods to see which blocks should be rendered. The Page component calls these methods to get the data that is associated with each block.
ShowroomBlock.tsx
/**
* Called from WP's block preview screen.
* Separate from getServerSideProps because private/session based data might need to be mocked.
* @returns
*/
export const getPreviewProps = async () => {
return await getPropsData();
};
/**
* Called by the page the block exists on within it's getServerSideProps method.
* The result is passed to the component props.
* @returns
*/
export const getServerSideProps = async () => {
return await getPropsData();
};