This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useForm, SubmitHandler } from "react-hook-form"; | |
interface IFormInput { | |
firstName: string; | |
lastName: string; | |
age: number; | |
} | |
export default function App() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useForm, SubmitHandler } from "react-hook-form"; | |
type Inputs = { | |
example: string, | |
exampleRequired: string, | |
}; | |
export default function App() { | |
const { register, handleSubmit, watch, formState: { errors } } = useForm<Inputs>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import express, { Application , Request, Response} from 'express'; | |
import nodemailer from "nodemailer"; | |
const transporter = nodemailer.createTransport({ | |
host: 'smtp.ethereal.email', | |
port: 587, | |
secure: false, | |
requireTLS: true, | |
auth: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Link from 'next/link' | |
import Layout from '../components/Layout' | |
const IndexPage = () => ( | |
<Layout title="Home | Next.js + TypeScript Example"> | |
<h1>Hello Next.js 👋</h1> | |
<p> | |
<Link href="/about"> | |
<a>About</a> | |
</Link> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { ReactNode } from 'react' | |
import Link from 'next/link' | |
import Head from 'next/head' | |
type Props = { | |
children?: ReactNode | |
title?: string | |
} | |
const Layout = ({ children, title = 'This is the default title' }: Props) => ( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"compilerOptions": { | |
"target": "es5", | |
"lib": [ | |
"dom", | |
"dom.iterable", | |
"esnext" | |
], | |
"allowJs": true, | |
"skipLibCheck": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {Scatter} from 'react-chartjs-2'; | |
const data = { | |
labels: ['Scatter'], | |
datasets: [ | |
{ | |
label: 'My First dataset', | |
fill: false, | |
backgroundColor: 'rgba(75,192,192,0.4)', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {Radar} from 'react-chartjs-2'; | |
const data = { | |
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'], | |
datasets: [ | |
{ | |
label: 'My First dataset', | |
backgroundColor: 'rgba(179,181,198,0.2)', | |
borderColor: 'rgba(179,181,198,1)', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import {Polar} from 'react-chartjs-2'; | |
const data = { | |
datasets: [{ | |
data: [ | |
11, | |
16, | |
7, | |
3, |