Closed
Description
In react-intl, FormattedMessage
accepts an optional description
prop. Also (see https://github.com/yahoo/react-intl/wiki/Components#message-descriptor),
type MessageDescriptor = {
id: string,
defaultMessage?: string,
description?: string | object,
};
has the optional description field, too, and the defaultMessage seems to be optional as well.
In Reason, we currently have
type message = {
.
"id": string,
"defaultMessage": string,
};
How would we model the two optional fields? I think we would need a makeMessage(Descriptor)
function with two optional labeled parameters.
And how do we model the fact that description may be either string or object? [@bs.unwrap]
(https://bucklescript.github.io/docs/en/function.html#trick-2-polymorphic-variant-bsunwrap)?
Metadata
Metadata
Assignees
Labels
No labels