Unverified Commit ec76d926 authored by Minh Nguyen's avatar Minh Nguyen Committed by GitHub
parent 287961ed
...@@ -85,7 +85,7 @@ For the initial page load, `getInitialProps` will execute on the server only. `g ...@@ -85,7 +85,7 @@ For the initial page load, `getInitialProps` will execute on the server only. `g
## TypeScript ## TypeScript
If you're using TypeScript, you can use the `NextPage` type for functional components: If you're using TypeScript, you can use the `NextPage` type for function components:
```jsx ```jsx
import { NextPage } from 'next' import { NextPage } from 'next'
......
...@@ -11,7 +11,7 @@ type Props = { ...@@ -11,7 +11,7 @@ type Props = {
} }
const WithInitialProps: NextPage<Props> = ({ items, pathname }) => ( const WithInitialProps: NextPage<Props> = ({ items, pathname }) => (
<Layout title="List Example (as Functional Component) | Next.js + TypeScript + Electron Example"> <Layout title="List Example (as Function Component) | Next.js + TypeScript + Electron Example">
<h1>List Example (as Function Component)</h1> <h1>List Example (as Function Component)</h1>
<p>You are currently on: {pathname}</p> <p>You are currently on: {pathname}</p>
<List items={items} /> <List items={items} />
......
...@@ -57,8 +57,8 @@ describe('Invalid hrefs', () => { ...@@ -57,8 +57,8 @@ describe('Invalid hrefs', () => {
}) })
afterAll(() => killApp(app)) afterAll(() => killApp(app))
it('should not show error for functional component with forwardRef', async () => { it('should not show error for function component with forwardRef', async () => {
await noError('/functional') await noError('/function')
}) })
it('should not show error for class component as child of next/link', async () => { it('should not show error for class component as child of next/link', async () => {
...@@ -83,7 +83,7 @@ describe('Invalid hrefs', () => { ...@@ -83,7 +83,7 @@ describe('Invalid hrefs', () => {
afterAll(() => killApp(app)) afterAll(() => killApp(app))
it('should preload with forwardRef', async () => { it('should preload with forwardRef', async () => {
await didPrefetch('/functional') await didPrefetch('/function')
}) })
it('should preload with child ref with React.createRef', async () => { it('should preload with child ref with React.createRef', async () => {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment