react-simple-i18n
Advanced tools
Comparing version 1.3.0-beta.0 to 1.3.0-beta.1
@@ -12,9 +12,5 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray"; | ||
useEffect(function () { | ||
i18n.listen(function () { | ||
setForceUpdate(undefined); | ||
}); | ||
i18n.listen(setForceUpdate); | ||
return function () { | ||
i18n.unlisten(function () { | ||
setForceUpdate(undefined); | ||
}); | ||
i18n.unlisten(setForceUpdate); | ||
}; | ||
@@ -21,0 +17,0 @@ }, []); |
@@ -24,9 +24,5 @@ "use strict"; | ||
(0, _react.useEffect)(function () { | ||
i18n.listen(function () { | ||
setForceUpdate(undefined); | ||
}); | ||
i18n.listen(setForceUpdate); | ||
return function () { | ||
i18n.unlisten(function () { | ||
setForceUpdate(undefined); | ||
}); | ||
i18n.unlisten(setForceUpdate); | ||
}; | ||
@@ -33,0 +29,0 @@ }, []); |
{ | ||
"name": "react-simple-i18n", | ||
"version": "1.3.0-beta.0", | ||
"version": "1.3.0-beta.1", | ||
"description": "React i18n solution with context API", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -11,13 +11,9 @@ import { Dispatch, SetStateAction, useContext, useEffect, useState } from 'react' | ||
const i18n = useContext(I18nContext) | ||
const [, setForceUpdate] = useState<undefined>() | ||
const [, setForceUpdate] = useState<any>() | ||
useEffect(() => { | ||
i18n.listen(() => { | ||
setForceUpdate(undefined); | ||
}) | ||
i18n.listen(setForceUpdate) | ||
return () => { | ||
i18n.unlisten(() => { | ||
setForceUpdate(undefined); | ||
}) | ||
i18n.unlisten(setForceUpdate) | ||
} | ||
@@ -24,0 +20,0 @@ }, []) |
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
0
0
293029
1057