nzxt documentation

Create your first application

install packages.

> yarn add nzxt zheleznaya

create pages.

> mkdir pages
> touch pages/index.tsx

You must create typescript code.

implement pages.

import { h, Component } from "nzxt/h";

interface Props {
  stars: number;
}

const Index: Component<Props> = ({ stars }) => {
  return (
    <h1>nzxt stars: {stars}</h1>
  );
}

Index.getInitialProps = async () => {
  const json = await fetch("https://api.github.com/repos/naoki-tomita/nzxt").then(res => res.json());
  return { stars: json.stargazers_count };
}

run server.

> yarn nzxt

You can see on http://localhost:8080

<- prev / next ->