UNPKG

@alifd/meet-react

Version:

Fusion Mobile React UI System Component

10 lines 497 B
import React, { useContext } from "react"; import { default as Context } from './context'; import { getLocale } from './utils'; export function useLocale(componentName) { var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; var defaultLocale = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; var _useContext = useContext(Context), locale = _useContext.locale; return getLocale(locale || {}, componentName, props, defaultLocale); }