I am trying to send some text on basic of hosted URL (where my build is deployed), but I am getting this error:
ReferenceError: location is not defined
Here is my code.
export const getStaticProps = async ({ preview = false, previewData = {} }) => {
return {
revalidate: 200,
props: {
//req.host
name: location.hostname == "www.google.com" ? "Hello" : "ccccc"
}
};
};