Skip to content

Commit

Permalink
delete console log
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick committed Jan 24, 2022
1 parent 7e3fba2 commit 69a24e9
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 16 deletions.
2 changes: 0 additions & 2 deletions doc/src/examples/controlled/Basic/Basic.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export function Basic() {
);

const handleSubmit = function(event: any){
console.log("handleSubmit");
if(event && event.preventDefault) {
event.preventDefault();
}
Expand All @@ -24,7 +23,6 @@ export function Basic() {
}
});
}
console.log('render!!', getValue("first_name"));

const setDefault = (event: any) => {
if(event && event.preventDefault) {
Expand Down
2 changes: 0 additions & 2 deletions doc/src/pages/forms/_forms/uncontrolled/Uncontrolled.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ export function Uncontrolled() {
}
});
};
console.log('render!!');

const setDefault = (event: any) => {
if(event && event.preventDefault) {
Expand All @@ -51,7 +50,6 @@ export function Uncontrolled() {

const deleteLastHobby = () => {
const groupItem = getItemByIndex({inputName: "hobbies", index: getGroup("hobbies").length - 1});
console.log(groupItem, 'groupItem')
if(groupItem){
deleteGroupItem({inputName: "hobbies", groupInputId: groupItem.id});
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "formmod",
"version": "1.3.6",
"version": "1.3.7",
"description": "Powerful form system for React with hooks",
"author": "Stepanov Nickolay",
"license": "MIT",
Expand Down
1 change: 0 additions & 1 deletion src/api/groups.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ export type GroupsParams = {

export const groups: Groups = ({ updateFormState }) => {
const getItemByIndex: GetItemByIndex = ({ formState, inputName, index }) => {
console.log(index, typeof index, 'index');
if (typeof index === 'number' && index >= 0) {
const group = getGroup({ formState, inputName });
return group ? group[index] : undefined;
Expand Down
1 change: 0 additions & 1 deletion src/api/setValues.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ export const setValues: SetValues = ({
_formState.formValue[inputName] = inputsValues[inputName];
});

console.log(_formState, 'ddd11s');
//cancell update state each render for edit mode
// this state must update only first render
if (editMode && isOnInitEdit) {
Expand Down
8 changes: 2 additions & 6 deletions src/api/useRefmod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,7 @@ export const useRefMod: UseRefMod = ({
}) => {
useEffect(() => {
const eventListeners = getEventListeners();
console.log('mount element!!');
return () => {
console.log('unmount element!!');
removeEventListeners({ inputName, eventListeners });
deleteEventListener(inputName);
};
Expand Down Expand Up @@ -136,7 +134,6 @@ export const useRefMod: UseRefMod = ({
eventListeners[indexReinit].element
)
) {
console.log('new DOM element', eventListeners[indexReinit]);
eventListeners[indexReinit] = listenerObj;
}
} else {
Expand All @@ -158,12 +155,11 @@ export const useRefMod: UseRefMod = ({

if (listener) {
// reinit input
console.log('reinit input', listener.inputName);

//console.log('reinit input', listener.inputName);
// listener.getFormState = getFormState;
} else {
// init input
console.log('init input', inputName);
//console.log('init input', inputName);

initInput(undefined, groupInputId);
// updateEventListeners();
Expand Down
1 change: 0 additions & 1 deletion src/api/useStateForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export const useStateForm = (initFormState: FormState) => {
}
if (editMode && !isOnInitEdit()) {
setOnInitFromEdit(true);
console.log(newFormState, 'newFormState!!');
updateInitState(newFormState);
}
return formState;
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ export const useFormMod = (initFormState: FormState) => {

useEffect(() => {
return () => {
console.log('unmount form');
deleteAllEventListeners();
};
}, []);
Expand Down
1 change: 0 additions & 1 deletion src/stategy/refComponents/addEventListeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ export const addEventListeners: AddEventListeners = ({
) {
clearTimeout(this.timer);
this.timer = setTimeout(() => {
console.log('change');
setValue({
formState: this.getFormState(),
inputName,
Expand Down

0 comments on commit 69a24e9

Please sign in to comment.