Untitled

mail@pastecode.io avatar
unknown
plain_text
2 months ago
449 B
1
Indexable
Never
import React, { useState } from 'react';

const ImageUploader = () => {
  const handleImageChange = (e) => {
    const files = e.target.files;
    const newImages = Array.from(files);

    // Store selected images in session storage
    sessionStorage.setItem('uploadedImages', JSON.stringify(newImages));
  };

  return (
    <div>
      <input type="file" onChange={handleImageChange} multiple />
    </div>
  );
};

export default ImageUploader;
Leave a Comment