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

Ensure latest React types for experimental release channel are used #48641

Merged
merged 4 commits into from
Apr 21, 2023
Merged
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
9 changes: 1 addition & 8 deletions packages/next/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/// <reference types="node" />
/// <reference types="react" />
/// <reference types="react/experimental" />
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also pulls in typings for next which include types for use and cache

/// <reference types="react-dom" />

import React from 'react'
Expand Down Expand Up @@ -42,19 +43,11 @@ declare module 'react' {
amp?: string
}

// <link nonce=""> support
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

interface LinkHTMLAttributes<T> extends HTMLAttributes<T> {
nonce?: string
}

// <img fetchPriority=""> support
// eslint-disable-next-line @typescript-eslint/no-unused-vars -- It's actually required for module augmentation to work.
interface ImgHTMLAttributes<T> {
fetchPriority?: 'high' | 'low' | 'auto' | undefined
}

function use<T>(promise: Promise<T> | React.Context<T>): T
function cache<T extends Function>(fn: T): T
}

export type Redirect =
Expand Down