diff --git a/libs/intl/src/useIntlContext.tsx b/libs/intl/src/useIntlContext.tsx index 365be56..5ff5fdb 100644 --- a/libs/intl/src/useIntlContext.tsx +++ b/libs/intl/src/useIntlContext.tsx @@ -1,12 +1,12 @@ import * as React from "react"; -import { IntlContext } from "./IntlProvider"; +import { IntlContext, IntlContextType } from "./IntlProvider"; export function useIntlContext() { const context = React.useContext(IntlContext); if (!context) { - throw new Error("useIntlContext must be used within a IntlProvider"); + return null as unknown as IntlContextType; } return context;