Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 96725cb

Browse filesBrowse files
nstepienlonglho
authored andcommitted
feat(react-intl): adopt React.JSX types in prep for React 19
1 parent 00bc9f1 commit 96725cb
Copy full SHA for 96725cb

File tree

Expand file treeCollapse file tree

6 files changed

+9
-6
lines changed
Filter options
Expand file treeCollapse file tree

6 files changed

+9
-6
lines changed

‎packages/react-intl/src/components/provider.tsx

Copy file name to clipboardExpand all lines: packages/react-intl/src/components/provider.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export default class IntlProvider extends React.PureComponent<
7676
return null
7777
}
7878

79-
render(): JSX.Element {
79+
render(): React.JSX.Element {
8080
invariantIntlContext(this.state.intl)
8181
return <Provider value={this.state.intl}>{this.props.children}</Provider>
8282
}

‎packages/react-intl/src/types.ts

Copy file name to clipboardExpand all lines: packages/react-intl/src/types.ts
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export type IntlConfig = Omit<
1818

1919
export interface ResolvedIntlConfig
2020
extends CoreResolvedIntlConfig<React.ReactNode> {
21-
textComponent?: React.ComponentType | keyof React.ReactHTML
21+
textComponent?: React.ComponentType | keyof React.JSX.IntrinsicElements
2222
wrapRichTextChunksInFragment?: boolean
2323
}
2424

‎packages/react-intl/tests/functional/support/format.tsx

Copy file name to clipboardExpand all lines: packages/react-intl/tests/functional/support/format.tsx
+4-1Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export default function (ReactIntl: typeof IReactIntl, noParser?: boolean) {
1515
FormattedMessage,
1616
} = ReactIntl
1717

18-
const renderWithIntlProvider = (Element: JSX.Element, providerProps = {}) =>
18+
const renderWithIntlProvider = (
19+
Element: React.JSX.Element,
20+
providerProps = {}
21+
) =>
1922
render(
2023
<IntlProvider locale="en" {...providerProps}>
2124
{Element}

‎packages/react-intl/tests/unit/components/withIntl.tsx

Copy file name to clipboardExpand all lines: packages/react-intl/tests/unit/components/withIntl.tsx
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import injectIntl, {
66
import {render} from '@testing-library/react'
77
import {IntlShape} from '@formatjs/intl'
88

9-
const mountWithProvider = (el: JSX.Element) =>
9+
const mountWithProvider = (el: React.JSX.Element) =>
1010
render(<IntlProvider locale="en">{el}</IntlProvider>)
1111

1212
describe('injectIntl()', () => {

‎website/docs/react-intl/api.md

Copy file name to clipboardExpand all lines: website/docs/react-intl/api.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ interface IntlConfig {
132132
locale: string
133133
timeZone?: string
134134
formats: CustomFormats
135-
textComponent?: React.ComponentType | keyof React.ReactHTML
135+
textComponent?: React.ComponentType | keyof React.JSX.IntrinsicElements
136136
messages: Record<string, string> | Record<string, MessageFormatElement[]>
137137
defaultLocale: string
138138
defaultFormats: CustomFormats

‎website/docs/react-intl/components.md

Copy file name to clipboardExpand all lines: website/docs/react-intl/components.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ interface IntlConfig {
3232
defaultLocale: string
3333
defaultFormats: CustomFormats
3434
timeZone?: string
35-
textComponent?: React.ComponentType | keyof React.ReactHTML
35+
textComponent?: React.ComponentType | keyof React.JSX.IntrinsicElements
3636
wrapRichTextChunksInFragment?: boolean
3737
defaultRichTextElements?: Record<string, FormatXMLElementFn<React.ReactNode>>
3838
onError(err: string): void

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.