import styles from "./App.css"; import { BrowserRouter as Router, Route, Routes } from "react-router-dom"; import axios from 'axios' import {View} from 'react-native'; import { useFormStatus } from "react-dom"; import React, { useOptimistic, useState, useEffect, useRef, Component } from 'react'; import {useDropzone} from "react-dropzone"; function App({ onSubmit, onChange }){ const [files, setFiles] = useState([]); const {getRootProps, getInputProps} = useDropzone({ accept: {"image/*": []}, onDrop: acceptedFiles => { setFiles( acceptedFiles.map(file => Object.assign(file, { preview: URL.createObjectURL(file) }) ) ); }, }); const thumbs = files.map(file => (
URL.revokeObjectURL(file.preview)} alt={file.name} />
)); useEffect(() => { // Revoke the data uris to avoid memory leaks on unmount return () => files.forEach(file => URL.revokeObjectURL(file.preview)); }, [files]); return ( <>

Spin the Black Circle!

Managing Your Vinyl Record Collection

Easy Image Editor

Drag 'n' drop some files here, or click to select files

); } function MyForm() { /*const handleChange = (event) => { setname(event.target.value); }*/ const [editableValue, setEditableValue] = useState(''); const handleChange = (e) => setEditableValue(e.target.value); function handleSubmit(e) { // Prevent the browser from reloading the page e.preventDefault(); // Read the form data const form = e.target; const formData = new FormData(form); // You can pass formData as a fetch body directly: fetch('https://jsonplaceholder.typicode.com', { method: form.method, body: formData }); // Or you can work with it as a plain object: const formJson = Object.fromEntries(formData.entries()); console.log(formJson); } return ( ); } export default App;