Refactor and get rid of unessesary dependencies

This commit is contained in:
garronej
2023-02-25 18:11:23 +01:00
parent b5b3af4659
commit b300966fa8
41 changed files with 1334 additions and 1362 deletions

View File

@ -1,8 +1,8 @@
import "./tools/Array.prototype.every";
import React, { useMemo, useReducer, Fragment } from "react";
import type { KcContextBase, Validators, Attribute } from "./getKcContext/KcContextBase";
import type { I18n, MessageKeyBase } from "./i18n";
import { useConstCallback } from "powerhooks/useConstCallback";
import type { I18nBase, MessageKeyBase } from "./i18n";
import { useConstCallback } from "./tools/useConstCallback";
import { id } from "tsafe/id";
import { emailRegexp } from "./tools/emailRegExp";
@ -14,7 +14,7 @@ export function useGetErrors(params: {
attributes: { name: string; value?: string; validators: Validators }[];
};
};
i18n: I18n;
i18n: I18nBase;
}) {
const { kcContext, i18n } = params;
@ -319,7 +319,7 @@ export function useFormValidationSlice(params: {
};
/** NOTE: Try to avoid passing a new ref every render for better performances. */
passwordValidators?: Validators;
i18n: I18n;
i18n: I18nBase;
}) {
const {
kcContext,