remix-validated-form 2.1.0 → 2.1.1

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.
@@ -1,9 +1,9 @@
1
1
  $ npm run build:browser && npm run build:main
2
2
 
3
- > remix-validated-form@2.0.0-beta.2 build:browser
3
+ > remix-validated-form@2.1.0 build:browser
4
4
  > tsc --module ESNext --outDir ./browser
5
5
 
6
6
 
7
- > remix-validated-form@2.0.0-beta.2 build:main
7
+ > remix-validated-form@2.1.0 build:main
8
8
  > tsc --module CommonJS --outDir ./build
9
9
 
package/README.md CHANGED
@@ -18,12 +18,9 @@ To run `sample-app`:
18
18
 
19
19
  ```
20
20
  git clone https://github.com/airjp73/remix-validated-form
21
- cd remix-validated-form
22
- npm i
23
- cd sample-app
24
- npm i
25
- cd ..
26
- npm run sample-app
21
+ cd ./remix-validated-form
22
+ yarn install
23
+ yarn sample-app
27
24
  ```
28
25
 
29
26
  # Getting started
@@ -121,5 +121,5 @@ export function ValidatedForm({ validator, onSubmit, children, fetcher, action,
121
121
  if (event.defaultPrevented)
122
122
  return;
123
123
  setFieldErrors({});
124
- }, children: _jsxs(FormContext.Provider, { value: contextValue, children: [_jsx("input", { type: "hidden", value: subaction, name: "subaction" }, void 0), children] }, void 0) }, void 0));
124
+ }, children: _jsxs(FormContext.Provider, { value: contextValue, children: [subaction && (_jsx("input", { type: "hidden", value: subaction, name: "subaction" }, void 0)), children] }, void 0) }, void 0));
125
125
  }
@@ -127,6 +127,6 @@ function ValidatedForm({ validator, onSubmit, children, fetcher, action, default
127
127
  if (event.defaultPrevented)
128
128
  return;
129
129
  setFieldErrors({});
130
- }, children: (0, jsx_runtime_1.jsxs)(formContext_1.FormContext.Provider, { value: contextValue, children: [(0, jsx_runtime_1.jsx)("input", { type: "hidden", value: subaction, name: "subaction" }, void 0), children] }, void 0) }, void 0));
130
+ }, children: (0, jsx_runtime_1.jsxs)(formContext_1.FormContext.Provider, { value: contextValue, children: [subaction && ((0, jsx_runtime_1.jsx)("input", { type: "hidden", value: subaction, name: "subaction" }, void 0)), children] }, void 0) }, void 0));
131
131
  }
132
132
  exports.ValidatedForm = ValidatedForm;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "remix-validated-form",
3
- "version": "2.1.0",
3
+ "version": "2.1.1",
4
4
  "description": "Form component and utils for easy form validation in remix",
5
5
  "browser": "./browser/index.js",
6
6
  "main": "./build/index.js",
@@ -219,7 +219,9 @@ export function ValidatedForm<DataType>({
219
219
  }}
220
220
  >
221
221
  <FormContext.Provider value={contextValue}>
222
- <input type="hidden" value={subaction} name="subaction" />
222
+ {subaction && (
223
+ <input type="hidden" value={subaction} name="subaction" />
224
+ )}
223
225
  {children}
224
226
  </FormContext.Provider>
225
227
  </Form>