#
コード
import { NextPage } from 'next';
import React, { useState } from 'react';
const IndexPage: NextPage = () => {
const [image, setImage] = useState(undefined);
const onChangeImage = (e: React.ChangeEvent) => {
const file = e.target.files?.[0];
if (!file) return;
const reader = new FileReader();
reader.onload = () => {
setImage(reader.result as string);
};
reader.readAsDataURL(file);
};
return (
{image &&

}
);
};
export default IndexPage;