UNPKG

ra-core

Version:

Core components of react-admin, a frontend Framework for building admin applications on top of REST services, using ES6, React

28 lines 813 B
/** * Get the current locale and the ability to change it * * @example * * import { useLocaleState } from 'react-admin'; * * const availableLanguages = { * en: 'English', * fr: 'Français', * } * const LocaleSwitcher = () => { * const [locale, setLocale] = useLocaleState(); * return ( * <div> * <div>Language</div> * <Button disabled={locale === 'fr'} onClick={() => setLocale('fr')}> * English * </Button> * <Button disabled={locale === 'en'} onClick={() => setLocale('en')}> * French * </Button> * </div> * ); * }; */ export declare const useLocaleState: () => import("../store/useStore").useStoreResult<string>; //# sourceMappingURL=useLocaleState.d.ts.map