Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename functional component -> function component #11850

Merged
merged 1 commit into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/api-reference/data-fetching/getInitialProps.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ For the initial page load, `getInitialProps` will execute on the server only. `g

## 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
import { NextPage } from 'next'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type Props = {
}

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>
<p>You are currently on: {pathname}</p>
<List items={items} />
Expand Down
6 changes: 3 additions & 3 deletions test/integration/link-ref/test/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ describe('Invalid hrefs', () => {
})
afterAll(() => killApp(app))

it('should not show error for functional component with forwardRef', async () => {
await noError('/functional')
it('should not show error for function component with forwardRef', async () => {
await noError('/function')
})

it('should not show error for class component as child of next/link', async () => {
Expand All @@ -83,7 +83,7 @@ describe('Invalid hrefs', () => {
afterAll(() => killApp(app))

it('should preload with forwardRef', async () => {
await didPrefetch('/functional')
await didPrefetch('/function')
})

it('should preload with child ref with React.createRef', async () => {
Expand Down