react-intl
Advanced tools
Comparing version 6.2.10 to 6.3.0
import * as React from 'react'; | ||
import { IntlShape } from '../types'; | ||
declare global { | ||
interface Window { | ||
__REACT_INTL_CONTEXT__: React.Context<IntlShape> | undefined; | ||
} | ||
} | ||
export declare const Provider: React.Provider<IntlShape>; | ||
@@ -4,0 +9,0 @@ export declare const Context: React.Context<IntlShape>; |
@@ -8,4 +8,8 @@ import { __assign } from "tslib"; | ||
} | ||
// TODO: We should provide initial value here | ||
var IntlContext = React.createContext(null); | ||
// This is primarily dealing with packaging systems where multiple copies of react-intl | ||
// might exist | ||
var IntlContext = typeof window !== 'undefined' | ||
? window.__REACT_INTL_CONTEXT__ || | ||
(window.__REACT_INTL_CONTEXT__ = React.createContext(null)) | ||
: React.createContext(null); | ||
var IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider; | ||
@@ -12,0 +16,0 @@ export var Provider = IntlProvider; |
{ | ||
"name": "react-intl", | ||
"version": "6.2.10", | ||
"version": "6.3.0", | ||
"description": "Internationalize React apps. This library provides React components and an API to format dates, numbers, and strings, including pluralization and handling translations.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
import * as React from 'react'; | ||
import { IntlShape } from '../types'; | ||
declare global { | ||
interface Window { | ||
__REACT_INTL_CONTEXT__: React.Context<IntlShape> | undefined; | ||
} | ||
} | ||
export declare const Provider: React.Provider<IntlShape>; | ||
@@ -4,0 +9,0 @@ export declare const Context: React.Context<IntlShape>; |
@@ -11,4 +11,8 @@ "use strict"; | ||
} | ||
// TODO: We should provide initial value here | ||
var IntlContext = React.createContext(null); | ||
// This is primarily dealing with packaging systems where multiple copies of react-intl | ||
// might exist | ||
var IntlContext = typeof window !== 'undefined' | ||
? window.__REACT_INTL_CONTEXT__ || | ||
(window.__REACT_INTL_CONTEXT__ = React.createContext(null)) | ||
: React.createContext(null); | ||
var IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider; | ||
@@ -15,0 +19,0 @@ exports.Provider = IntlProvider; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
274742
6556