react-form-manage 1.0.8-beta.21 → 1.0.8-beta.22

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [1.0.8-beta.22] - 2026-02-02
6
+
7
+ ### Changes
8
+ - Refactor: Adjust useFormItemControl and main.tsx for better performance
9
+
5
10
  ## [1.0.8-beta.21] - 2026-02-02
6
11
 
7
12
  ### Fixes
@@ -80,7 +80,8 @@ function useFormItemControl({ formName, form, name, initialValue, formItemId, ru
80
80
  setListener({
81
81
  formItemId,
82
82
  isDirty: false,
83
- isTouched: false
83
+ isTouched: false,
84
+ isInitied: false
84
85
  });
85
86
  onChange(isNil(value2) ? getInitData(formName || (form == null ? void 0 : form.formName) || (contextForm == null ? void 0 : contextForm.formName), name) : value2, { notTriggerDirty: true, initiedData: true });
86
87
  };
@@ -280,9 +281,7 @@ function useFormItemControl({ formName, form, name, initialValue, formItemId, ru
280
281
  if (isStateInitied) {
281
282
  if (isNil(value)) {
282
283
  if (isNil(internalInitValue)) {
283
- if (!isNil(initialValue)) {
284
- onInitData(initialValue);
285
- }
284
+ onInitData(initialValue);
286
285
  } else {
287
286
  onChange(internalInitValue, {
288
287
  notTriggerDirty: true,
@@ -305,6 +304,7 @@ function useFormItemControl({ formName, form, name, initialValue, formItemId, ru
305
304
  emitFocus,
306
305
  isTouched: false,
307
306
  isDirty: false,
307
+ isInitied: true,
308
308
  name,
309
309
  formName: formName || (form == null ? void 0 : form.formName) || (contextForm == null ? void 0 : contextForm.formName),
310
310
  formItemId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-form-manage",
3
- "version": "1.0.8-beta.21",
3
+ "version": "1.0.8-beta.22",
4
4
  "description": "Lightweight React form management with list and listener support.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -201,6 +201,7 @@ export default function useFormItemControl<T = any>({
201
201
  formItemId,
202
202
  isDirty: false,
203
203
  isTouched: false,
204
+ isInitied: false,
204
205
  });
205
206
  onChange(
206
207
  isNil(value)
@@ -544,9 +545,7 @@ export default function useFormItemControl<T = any>({
544
545
 
545
546
  if (isNil(value)) {
546
547
  if (isNil(internalInitValue)) {
547
- if (!isNil(initialValue)) {
548
- onInitData(initialValue);
549
- }
548
+ onInitData(initialValue);
550
549
  } else {
551
550
  onChange(internalInitValue, {
552
551
  notTriggerDirty: true,
@@ -570,6 +569,7 @@ export default function useFormItemControl<T = any>({
570
569
  emitFocus,
571
570
  isTouched: false,
572
571
  isDirty: false,
572
+ isInitied: true,
573
573
  name,
574
574
  formName: formName || form?.formName || contextForm?.formName,
575
575
  formItemId,
package/src/main.tsx CHANGED
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { createRoot } from "react-dom/client";
2
3
  import App from "./App";
3
4
  import "./index.css";
@@ -7,4 +8,8 @@ if (!container) {
7
8
  throw new Error("Root container missing");
8
9
  }
9
10
 
10
- createRoot(container).render(<App />);
11
+ createRoot(container).render(
12
+ <React.StrictMode>
13
+ <App />
14
+ </React.StrictMode>,
15
+ );