Is that available in _document.js? That's where I want to set the class of <body>. So that the html sent from the server, either has <body class="dark-mode"> or <body class="light-mode">
<body>
<body class="dark-mode">
<body class="light-mode">
U can access it from getInitialProps inside _document
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Is that available in _document.js? That's where I want to set the class of
<body>
.So that the html sent from the server, either has
<body class="dark-mode">
or<body class="light-mode">
U can access it from getInitialProps inside _document