Skip to content

Commit

Permalink
#65 Refactor useIntlContext
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Beceic committed Apr 24, 2023
1 parent e1b0e4f commit a083d29
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libs/intl/src/useIntlContext.tsx
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit a083d29

Please sign in to comment.