Skip to content

Commit

Permalink
temp: ignore types
Browse files Browse the repository at this point in the history
  • Loading branch information
spiderman authored and spiderman committed Dec 2, 2024
1 parent 3a4ee86 commit cc20975
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 0 additions & 1 deletion apps/playground/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
RadioGroup,
TextField,
} from '@mui/material'
import Form from './form'

const userRepo = remult.repo(User)

Expand Down
5 changes: 3 additions & 2 deletions packages/remult-uikit/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,11 @@ export type SubmitData<T> = {
// [k in keyof T]?: string
// }

export const useRemultForm = <T extends FieldValues>(repo: Repository<T>) => {
export const useRemultForm = <T>(repo: Repository<T>) => {
// const [elements, setElements] = useState<T>({} as T);
// const [errorsX, setErrors] = useState<FormError<T>>({})

// @ts-expect-error
const useFormObj = useForm({ resolver: repoResolver(repo) })

// const register = (fieldId: keyof T) => {
Expand Down Expand Up @@ -80,7 +81,7 @@ export const useRemultForm = <T extends FieldValues>(repo: Repository<T>) => {
return useFormObj
}

const repoResolver = <T extends FieldValues>(repo: Repository<T>) => {
const repoResolver = <T>(repo: Repository<T>) => {
return async (values: T) => {
const errors = await repo.validate(values)
if (errors && errors.modelState)
Expand Down

0 comments on commit cc20975

Please sign in to comment.