mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-04-19 00:26:34 +08:00
Fix missing splat in react-intl types (#25046)
This commit is contained in:
committed by
Ryan Cavanaugh
parent
e460cfa0a3
commit
2b5e8a5dd3
2
types/react-intl/index.d.ts
vendored
2
types/react-intl/index.d.ts
vendored
@@ -142,7 +142,7 @@ declare namespace ReactIntl {
|
||||
interface Props extends MessageDescriptor {
|
||||
values?: {[key: string]: MessageValue | JSX.Element};
|
||||
tagName?: string;
|
||||
children?: (formattedMessage: string[]) => React.ReactNode;
|
||||
children?: (...formattedMessage: string[]) => React.ReactNode;
|
||||
}
|
||||
}
|
||||
class FormattedMessage extends React.Component<FormattedMessage.Props> { }
|
||||
|
||||
@@ -150,6 +150,20 @@ class SomeComponent extends React.Component<SomeComponentProps & InjectedIntlPro
|
||||
{(text) => <div className="messageDiv">{text}</div>}
|
||||
</FormattedMessage>
|
||||
|
||||
<FormattedMessage
|
||||
id="test"
|
||||
description="Test"
|
||||
>
|
||||
{(text) => <input placeholder={text} />}
|
||||
</FormattedMessage>
|
||||
|
||||
<FormattedMessage
|
||||
id="test"
|
||||
description="Test"
|
||||
>
|
||||
{(...text) => <ul>{text.map(t => <li>{t}</li>)}</ul>}
|
||||
</FormattedMessage>
|
||||
|
||||
<FormattedHTMLMessage
|
||||
id="test"
|
||||
description="Test"
|
||||
|
||||
Reference in New Issue
Block a user