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 Mar 6, 2023
1 parent ce5d0f4 commit 4ae047e
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 4ae047e

Please sign in to comment.