on master help sign in
updated kelvin and fixing error message
commite595f1d2f196fe7f2b33394fe4187944192f5770 authorHunter Miller <hunter@hmiller.dev> dateWed 4 Jan 2023, 22:59 (4 years ago) parenta2a97f9
4 files changed+6−5
desk/sys.kelvin+1−1 ui/src/components/ErrorMessage.tsx+3−3 ui/tailwind.config.js+1 ui/tsconfig.json+1−1
desk/sys.kelvin+1−1
@@ -1 +1 @@
1−[%zuse 418]
1+[%zuse 417]
ui/src/components/ErrorMessage.tsx+3−3
@@ -1,16 +1,16 @@
11import cn from 'classnames';
22import React from 'react';
3−import { LiteralUnion, RegisterOptions, useFormContext } from 'react-hook-form';
3+import { FieldValues, LiteralUnion, RegisterOptions, useFormContext } from 'react-hook-form';
44
55type Validation = LiteralUnion<keyof RegisterOptions, string>;
66
7−interface ErrorMessageProps<T> {
7+interface ErrorMessageProps<T extends FieldValues> {
88 field: keyof T;
99 messages: Partial<Record<Validation, string>>;
1010 className?: string;
1111}
1212
13−export function ErrorMessage<T>({ field, messages, className }: ErrorMessageProps<T>) {
13+export function ErrorMessage<T extends FieldValues>({ field, messages, className }: ErrorMessageProps<T>) {
1414 const { formState } = useFormContext<T>();
1515 const error = formState.errors[field];
1616
ui/tailwind.config.js+1
@@ -1,3 +1,4 @@
1+/** @type {import('tailwindcss').Config} */
12module.exports = {
23 content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
34 theme: {
ui/tsconfig.json+1−1
@@ -2,7 +2,7 @@
22 "compilerOptions": {
33 "target": "ESNext",
44 "lib": ["DOM", "DOM.Iterable", "ESNext"],
5− "allowJs": false,
5+ "allowJs": true,
66 "skipLibCheck": false,
77 "esModuleInterop": false,
88 "allowSyntheticDefaultImports": true,