UNPKG

@atlaskit/editor-common

Version:

A package that contains common classes and components for editor and renderer

14 lines 444 B
import React, { useContext } from 'react'; import { IntlContext, IntlProvider } from 'react-intl-next'; const useCheckIntlContext = () => useContext(IntlContext) === null; export default function IntlProviderIfMissingWrapper({ children }) { const missingIntlContext = useCheckIntlContext(); if (missingIntlContext) { return /*#__PURE__*/React.createElement(IntlProvider, { locale: "en" }, children); } return children; }