@melv1c/ui-kit 1.5.1 → 1.6.0

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
@@ -23,13 +23,13 @@ This library provides a collection of reusable, accessible UI components that fo
23
23
  ### Prerequisites
24
24
 
25
25
  - Node.js 22+
26
- - npm
26
+ - Bun
27
27
 
28
28
  ### Setup
29
29
 
30
30
  ```bash
31
- npm install
32
- npm run dev
31
+ bun install
32
+ bun run dev
33
33
  ```
34
34
 
35
35
  This starts the Storybook dev server on `http://localhost:6006`.
package/dist/index.cjs CHANGED
@@ -4525,9 +4525,13 @@ function UIKitProvider({
4525
4525
  i18nConfig = { locale: "en" },
4526
4526
  loadingComponent = null
4527
4527
  }) {
4528
- const [isReady, setIsReady] = React9.useState(false);
4529
- const i18nRef = React9.useRef(!i18nConfig.instance ? i18n__default.default.createInstance() : null);
4530
- const instance = i18nConfig.instance || i18nRef.current;
4528
+ const [localInstance] = React9.useState(
4529
+ () => !i18nConfig.instance ? i18n__default.default.createInstance() : null
4530
+ );
4531
+ const instance = i18nConfig.instance || localInstance;
4532
+ const [isReady, setIsReady] = React9.useState(
4533
+ () => !(i18nConfig.locale && !instance.isInitialized)
4534
+ );
4531
4535
  React9.useEffect(() => {
4532
4536
  if (i18nConfig.locale && !instance.isInitialized) {
4533
4537
  instance.use(reactI18next.initReactI18next).init({
@@ -4541,8 +4545,6 @@ function UIKitProvider({
4541
4545
  }).then(() => {
4542
4546
  setIsReady(true);
4543
4547
  });
4544
- } else {
4545
- setIsReady(true);
4546
4548
  }
4547
4549
  }, [i18nConfig, instance]);
4548
4550
  React9.useEffect(() => {