Skip to content
Discussion options

You must be logged in to vote

The URL undefined was because I didn't prepend the PROD_URL env variable with NEXT_PUBLIC_

But I also had to change the route to find by Id then in components use the Id in the custom hook so the hook works properly now:

const Branding = (props) => {
  const { data } = useSiteSettings(1);

  return (
    <div className={`${styles.branding_container} ${props.noGutter ? styles.no_gutter : ''}`}>
      <img className={styles.vcc_logo} src={data.siteLogo} />
    </div>
  );
};

In pages, the Id had to be used too:

export async function getServerSideProps() {
  // Fetch site settings
  const queryClient = new QueryClient();
  await queryClient.prefetchQuery(['siteSettings', 1], () => getSettin…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by jinsley8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant