Skip to main content

Function: msg()

msg(descriptor, values?): MessageRef

Defined in: messageRef.ts:42

Create a message reference from a descriptor declared with defineMessages.

Parameters​

ParameterType
descriptorMessageDescriptor
values?Record<string, MessageValue>

Returns​

MessageRef

Throws​

when the descriptor has no id or no defaultMessage — a reference that cannot be looked up, or cannot fall back, would render as an empty string far from where it was created.