mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
In the react-intl source the prop is defined as follows:
tagName: PropTypes.oneOfType([PropTypes.string, PropTypes.element])
But it's actually passed straight to React.createElement(tagName, …),
so any type that is accepted by createElement should be allowed here.
It is useful to allow passing custom components to FormattedMessage,
for example when you use styled components, eg.
const FancyHeading = styled('h1')`font-size: 32px`;
<FormattedMessage … tagName={FancyHeading} />
|
||
|---|---|---|
| .. | ||
| v1 | ||
| index.d.ts | ||
| react-intl-tests.tsx | ||
| tsconfig.json | ||
| tslint.json | ||