Skip to content
Discussion options

You must be logged in to vote

Found a way 🕺 🥳

This is working for me

import React from 'react'

const str = `<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,700|Montserrat:900">
    <title>Document</title>
    <style>

body{
    background-color: white;
}
  


    </style>
</head>
<body>
    
<div id="test">
<h1>Testing</h1>

</div>

</body>
</html>`;
class Page extends React.Component {
  static async getInitialProps(ctx) {
    ctx.res.setHeader('Content-type', 'text/html')
    ctx.res.write(str);
    ctx.res.end();
  }
}

export default Page

J…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@IRediTOTO
Comment options

Answer selected by sasikanth513
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants