locon 1.4.3 → 1.4.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
  [![GitHub tag](https://img.shields.io/github/v/tag/loconapp/locon?display_name=tag)](https://github.com/loconapp/locon/tags)
5
5
  [![Release workflow](https://github.com/loconapp/locon/actions/workflows/release.yml/badge.svg)](https://github.com/loconapp/locon/actions/workflows/release.yml)
6
6
 
7
+ [Website](https://locon.dev) · [npm](https://www.npmjs.com/package/locon) · [GitHub](https://github.com/loconapp/locon)
8
+
7
9
  `locon` is a small, typed i18n helper for React Native.
8
10
  It provides a context provider, a hook, and a simple text component to keep
9
11
  your translations flat, explicit, and easy to use.
package/dist/index.js CHANGED
@@ -114,10 +114,10 @@ function Locon({
114
114
  [getAsset, getAssetByValue, defaultLocale]
115
115
  );
116
116
  (0, import_react.useEffect)(() => {
117
- if (currentLocaleProps && currentLocaleProps !== currentLocale) {
118
- setCurrentLocale(currentLocaleProps);
117
+ if (currentLocaleProps) {
118
+ setCurrentLocale((locale) => locale === currentLocaleProps ? locale : currentLocaleProps);
119
119
  }
120
- }, [currentLocaleProps, currentLocale]);
120
+ }, [currentLocaleProps]);
121
121
  const value = (0, import_react.useMemo)(
122
122
  () => ({
123
123
  assets,
package/dist/index.mjs CHANGED
@@ -76,10 +76,10 @@ function Locon({
76
76
  [getAsset, getAssetByValue, defaultLocale]
77
77
  );
78
78
  useEffect(() => {
79
- if (currentLocaleProps && currentLocaleProps !== currentLocale) {
80
- setCurrentLocale(currentLocaleProps);
79
+ if (currentLocaleProps) {
80
+ setCurrentLocale((locale) => locale === currentLocaleProps ? locale : currentLocaleProps);
81
81
  }
82
- }, [currentLocaleProps, currentLocale]);
82
+ }, [currentLocaleProps]);
83
83
  const value = useMemo(
84
84
  () => ({
85
85
  assets,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "locon",
3
- "version": "1.4.3",
3
+ "version": "1.4.6",
4
4
  "description": "locon is a simple and lightweight library for React Native that provides a simple way to manage translations in your app.",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -10,8 +10,7 @@
10
10
  ],
11
11
  "scripts": {
12
12
  "build": "tsup",
13
- "test": "jest",
14
- "publish": "npm publish"
13
+ "test": "jest"
15
14
  },
16
15
  "keywords": [
17
16
  "i18n",
@@ -28,6 +27,14 @@
28
27
  ],
29
28
  "author": "loconapp",
30
29
  "license": "ISC",
30
+ "homepage": "https://locon.dev",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/loconapp/locon.git"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/loconapp/locon/issues"
37
+ },
31
38
  "peerDependencies": {
32
39
  "react": ">=19.0.0",
33
40
  "react-native": ">=0.70.0",