useCollator

Provides a cached Intl.Collator instance for locale-sensitive string comparison.

Provides localised string collation for the current locale. It automatically updates when the locale changes and uses performance-optimised caching. For detailed information about collation options and behaviour, see the Intl.Collator documentation​.

Import#

import { useCollator } from '@volue/wave-react';

Example#


API reference#

Arguments#

Prop
Type
Default
locale*
string
—
options
Intl.CollatorOptions
—

Returns#

Intl.Collator — A cached collator instance for the given locale and options.