Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: createFormControl and subscribe function #11522

Draft
wants to merge 41 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
ef81039
feat: createFormControl outside of component
bluebill1049 Feb 17, 2024
08dffeb
first draft api
bluebill1049 Feb 17, 2024
7d56995
improved type check
bluebill1049 Feb 17, 2024
9d27a71
update api contract
bluebill1049 Feb 17, 2024
3b79e8c
fix build
bluebill1049 Feb 17, 2024
b1ec4ad
useForm impl complete with subscribe
bluebill1049 Feb 18, 2024
b5cba6b
split values and other formState sub
bluebill1049 Feb 18, 2024
adf2141
integrate with useForm
bluebill1049 Feb 18, 2024
e6ef10a
fix render root issue
bluebill1049 Feb 18, 2024
481bcc7
integrate with useFormState
bluebill1049 Feb 18, 2024
b20084c
fix subscription with formState
bluebill1049 Feb 18, 2024
bddb24c
include useWatch integration
bluebill1049 Feb 18, 2024
9e3edf0
remove useSubscribe
bluebill1049 Feb 18, 2024
d293c22
fix lint error
bluebill1049 Feb 18, 2024
de86520
remove useFieldArray unregister
bluebill1049 Feb 18, 2024
a736e18
merge subscription to single state
bluebill1049 Feb 18, 2024
b9b9c02
update api contract
bluebill1049 Feb 18, 2024
99cbc9e
remove NestedValue
bluebill1049 Feb 18, 2024
f6f9b02
remove nested value and expose the create form control method
bluebill1049 Feb 18, 2024
cffbe68
update api contract and fix build
bluebill1049 Feb 18, 2024
da269cf
fix app build
bluebill1049 Feb 18, 2024
8af040f
fix issue with missing formState
bluebill1049 Feb 24, 2024
3e584fe
Merge branch 'master' into feat/createFormControl
bluebill1049 Feb 24, 2024
688c8a6
update with tests coverage
bluebill1049 Feb 24, 2024
78174fe
fix build
bluebill1049 Feb 24, 2024
c2c2e50
update api contractor
bluebill1049 Feb 24, 2024
43cdae4
Merge branch 'master' into feat/createFormControl
bluebill1049 Feb 24, 2024
bb914fe
seperate proxy subscription between hook and subscribe function
bluebill1049 Feb 24, 2024
b4f6a1c
update package size
bluebill1049 Feb 25, 2024
3cf0828
remove unused method
bluebill1049 Feb 25, 2024
14d4f20
remove unused method
bluebill1049 Feb 25, 2024
3e4eaeb
update all export json
bluebill1049 Feb 25, 2024
c3c3996
update api contractor
bluebill1049 Feb 25, 2024
afbc065
fix build
bluebill1049 Feb 25, 2024
31f927f
Merge branch 'master' into feat/createFormControl
bluebill1049 Feb 25, 2024
48c57a9
Merge branch 'master' into feat/createFormControl
bluebill1049 Mar 1, 2024
0984a0d
minor code improvement
bluebill1049 Mar 17, 2024
623c31f
Merge branch 'master' into feat/createFormControl
bluebill1049 Mar 17, 2024
8012d45
fix code format
bluebill1049 Mar 17, 2024
669a6c8
Merge branch 'master' into feat/createFormControl
bluebill1049 Apr 6, 2024
d492f7c
Merge branch 'master' into feat/createFormControl
bluebill1049 May 5, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/src/autoUnregister.tsx
@@ -1,6 +1,6 @@
import React, { useState } from 'react';
import ReactSelect from 'react-select';
import { useForm, Controller, NestedValue } from 'react-hook-form';
import { useForm, Controller } from 'react-hook-form';

const options = [
{ value: 'chocolate', label: 'Chocolate' },
Expand All @@ -15,7 +15,7 @@ export default function AutoUnregister() {
test2: boolean;
test3: string;
test4: string;
ReactSelect: NestedValue<{ label: string; value: string }>;
ReactSelect: { label: string; value: string };
}>();
const [show, setShow] = useState(true);

Expand Down
4 changes: 2 additions & 2 deletions app/src/basic.tsx
@@ -1,5 +1,5 @@
import React, { useState } from 'react';
import { useForm, NestedValue, ValidationMode } from 'react-hook-form';
import { useForm, ValidationMode } from 'react-hook-form';
import { useParams } from 'react-router-dom';

let renderCounter = 0;
Expand All @@ -25,7 +25,7 @@ const Basic: React.FC = () => {
pattern: string;
radio: string;
checkbox: string;
checkboxArray: NestedValue<string[]>;
checkboxArray: string[];
multiple: string;
validate: string;
nestItem: {
Expand Down
4 changes: 2 additions & 2 deletions app/src/defaultValues.tsx
@@ -1,5 +1,5 @@
import React from 'react';
import { NestedValue, useForm } from 'react-hook-form';
import { useForm } from 'react-hook-form';

function DefaultValues() {
const { register } = useForm<{
Expand All @@ -11,7 +11,7 @@ function DefaultValues() {
nest: string;
};
};
checkbox: NestedValue<string[]>;
checkbox: string[];
}>({
defaultValues: {
test: 'test',
Expand Down
6 changes: 3 additions & 3 deletions app/src/setValue.tsx
@@ -1,5 +1,5 @@
import React, { useEffect } from 'react';
import { useForm, NestedValue } from 'react-hook-form';
import { useForm } from 'react-hook-form';

let renderCounter = 0;

Expand All @@ -18,14 +18,14 @@ const SetValue: React.FC = () => {
checkboxArray: string[];
radio: string;
select: string;
multiple: NestedValue<string[]>;
multiple: string[];
array: string[];
object: {
firstName: string;
lastName: string;
middleName: string;
};
nestedValue: NestedValue<string[]>;
nestedValue: string[];
}>();

useEffect(() => {
Expand Down
181 changes: 0 additions & 181 deletions cypress/e2e/useFieldArrayUnregister.cy.ts

This file was deleted.

4 changes: 2 additions & 2 deletions examples/V7/nativeMultipleInput.tsx
@@ -1,13 +1,13 @@
import React from 'react';
import { useForm, NestedValue } from 'react-hook-form';
import { useForm } from 'react-hook-form';

export default function App() {
const {
register,
formState: { errors },
handleSubmit,
} = useForm<{
email: NestedValue<string[]>;
email: string[];
}>({
defaultValues: {
email: ['first@react.hook.form', 'last@react.hook.form'],
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -118,7 +118,7 @@
"files": [
{
"path": "./dist/index.cjs.js",
"maxSize": "10.1 kB"
"maxSize": "10.5 kB"
}
]
},
Expand Down