Skip to content

Commit

Permalink
bug-fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ankman007 committed Sep 19, 2024
1 parent eed4f46 commit db52493
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/components/Form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Button, Box, Typography } from "@mui/material";
const fields: FieldProps[] = (data as { fields: FieldProps[] }).fields;

type FormData = {
[key: string]: string | boolean | string[] | undefined; // Removed File type here
[key: string]: string | boolean | string[] | undefined;
};

const Form: React.FC = () => {
Expand All @@ -23,7 +23,7 @@ const Form: React.FC = () => {

const handleSubmit = (e: React.FormEvent<HTMLFormElement>) => {
e.preventDefault();
console.log("Form Data:", formData); // Log form data
console.log("Form Data:", formData);
setSubmitted(true);
};

Expand All @@ -38,7 +38,7 @@ const Form: React.FC = () => {
name={field.name}
label={field.label}
options={field.options}
value={formData[field.name] ?? (field.type === 'checkbox' ? false : '')} // Default value based on field type
value={formData[field.name] ?? (field.type === 'checkbox' ? false : '')}
onChange={(value) => handleChange(field.name, value)}
/>
</Box>
Expand Down
1 change: 0 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'

// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
})

0 comments on commit db52493

Please sign in to comment.