Skip to content
ConcordConcordConcord

Components.try

Returns true and the ComponentClass if one was registered with the specified name

← Components

Returns true and the ComponentClass if one was registered with the specified name

or false and an error otherwise

ok = Components.try( name, acceptRejected )
Name Type Description
name string Name of the ComponentClass to check
acceptRejected boolean Whether to accept names prefixed with the Reject Prefix.
Name Type Description
ok boolean
componentClass ComponentClass|string ComponentClass on success, or an error string on failure
rejected string|boolean On success: the stripped Component name if the name had the Reject Prefix, otherwise false