Next.js/TypeScript: how to add nextPage type to class components?

Viewed 124

I like to work with es6 classes and I'm trying to get proper typings for my next.js project based on typescript.

How do you implement NextPage type in a class component?

import React, { Component } from "react";
import { NextPage } from "next";

export class Index extends Component {
  render() {
    return <div>Index</div>;
  }
}

export default Index;
0 Answers
Related