Next.js: How can I change custom attributes to the <body> html tag from next/head

Created on 14 Aug 2019  路  1Comment  路  Source: vercel/next.js

I want to dynamically set the body classname

import Head from "next/head";
...
let Device = () => {
  return (
    <React.Fragment>
      <Head>
        <title>Device</title>
        <body className="page-device" />
      </Head>
      <div>Device</div>
    </React.Fragment>
  );
};
export default Device;
...

but

image
image

>All comments

Please follow the issue template's instructions -- questions belong on our Spectrum.

Was this page helpful?
0 / 5 - 0 ratings