useCollator
Provides a cached Intl.Collator instance for locale-sensitive string comparison.
Provides localized string collation for the current locale. It automatically updates when the locale changes and uses performance-optimized caching. For detailed information about collation options and behavior, 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.