@formisch/react 0.2.0 → 0.2.2

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
@@ -9,7 +9,7 @@ Formisch is also available for [Preact][formisch-preact], [Qwik][formisch-qwik],
9
9
  - Small bundle size starting at 2.5 kB
10
10
  - Schema-based validation with Valibot
11
11
  - Type safety with autocompletion in editor
12
- - It's fast – DOM updates are fine-grained
12
+ - It's fast – re-renders only if necessary
13
13
  - Minimal, readable and well thought out API
14
14
  - Supports all native HTML form fields
15
15
 
package/dist/index.js CHANGED
@@ -117,7 +117,7 @@ function untrack(fn) {
117
117
  function initializeFieldStore(internalFieldStore, schema, initialInput, path, nullish = false) {
118
118
  if (framework === "qwik" && schema.type === "lazy" || schema.type === "object_with_rest" || schema.type === "record" || schema.type === "tuple_with_rest" || schema.type === "promise") throw new Error(`"${schema.type}" schema is not supported`);
119
119
  else if (schema.type === "lazy") initializeFieldStore(internalFieldStore, schema.getter(void 0), initialInput, path);
120
- else if (schema.type === "exact_optional" || schema.type === "nullable" || schema.type === "nullish" || schema.type === "optional" || schema.type === "undefinedable") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput ?? v.getDefault(schema), path, true);
120
+ else if (schema.type === "exact_optional" || schema.type === "nullable" || schema.type === "nullish" || schema.type === "optional" || schema.type === "undefinedable") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput === void 0 ? v.getDefault(schema) : initialInput, path, true);
121
121
  else if (schema.type === "non_nullable" || schema.type === "non_nullish" || schema.type === "non_optional") initializeFieldStore(internalFieldStore, schema.wrapped, initialInput, path);
122
122
  else if (schema.type === "intersect" || schema.type === "union" || schema.type === "variant") for (const schemaOption of schema.options) initializeFieldStore(internalFieldStore, schemaOption, initialInput, path);
123
123
  else {
@@ -480,8 +480,8 @@ function setFieldInput(internalFormStore, path, input) {
480
480
  for (let index = 0; index < path.length; index++) {
481
481
  internalFieldStore = internalFieldStore.children[path[index]];
482
482
  if (index < path.length - 1) internalFieldStore.input.value = true;
483
- else setNestedInput(internalFieldStore, input);
484
483
  }
484
+ setNestedInput(internalFieldStore, input);
485
485
  });
486
486
  });
487
487
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formisch/react",
3
3
  "description": "The modular and type-safe form library for React",
4
- "version": "0.2.0",
4
+ "version": "0.2.2",
5
5
  "license": "MIT",
6
6
  "author": "Fabian Hiller",
7
7
  "homepage": "https://formisch.dev",
@@ -48,8 +48,8 @@
48
48
  "typescript": "~5.9.3",
49
49
  "typescript-eslint": "^8.46.4",
50
50
  "vite": "^7.2.4",
51
- "@formisch/core": "0.4.3",
52
- "@formisch/methods": "0.5.1"
51
+ "@formisch/core": "0.4.5",
52
+ "@formisch/methods": "0.5.2"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "react": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",