( Comp: React.ComponentType
-) {
+): (
+ props: P & {children?(nodes: React.ReactNode[]): React.ReactNode},
+ providerProps?: IntlConfig
+) => RenderResult & {
+ rerenderProps: (
+ newProps?: P & {children?(nodes: React.ReactNode[]): React.ReactNode},
+ newProviderProps?: IntlConfig
+ ) => void
+} {
return (
props: P & {children?(nodes: React.ReactNode[]): React.ReactNode},
providerProps: IntlConfig = {locale: 'en'}
diff --git a/packages/react-intl/tests/unit/types.test.tsx b/packages/react-intl/tests/unit/types.test.tsx
new file mode 100644
index 00000000000..18db95dbeec
--- /dev/null
+++ b/packages/react-intl/tests/unit/types.test.tsx
@@ -0,0 +1,91 @@
+import React from 'react'
+import {defineMessages, injectIntl, IntlShape, useIntl} from '../../'
+
+describe('types', () => {
+ // https://github.com/formatjs/formatjs/issues/3856
+ it('works with react18 typing', () => {
+ function Test() {
+ const messages = defineMessages({
+ greeting: {
+ id: 'app.greeting',
+ defaultMessage: 'Hello,