Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

154
Visualizações
Combine an uploaded image and a draggable text and download it together in react

I am new to react and js. Is there any way that I can upload an image and move the draggable text on top of that image and when I click download the image along with the download get saved?? Any help is much appreciated.

My App.js

import './App.css';
import Land from './Land';
import React from 'react';
import Draggable from 'react-draggable';
import { saveAs } from 'file-saver'


function App() {

  const [file, setFile] = React.useState();
  function handleChange(e) {
      console.log(e.target.files);
      setFile(URL.createObjectURL(e.target.files[0]));
  }

    const downloadImage = () => {
      saveAs(file, 'image.jpg') // Put your image url here.
    }



  return (
      <div className="App">
          <h2>Add Image:</h2>
          <input type="file" onChange={handleChange} />

          
          <div className='img-container'>

           <Land/>
          <img src={file} width ="100%"/>

          <button onClick={downloadImage}>Download!</button>
          </div>

      </div>

  );

}

export default App;

My Land.js

import React from 'react';
import Navbar from './Navbar';
import Hero from './Hero';
import pic from './me.png'

import Draggable from 'react-draggable';
export default function Land()
{
    return(
        <div>
            
            <Draggable>
      <div>I can now be moved around!</div>
    </Draggable>
        </div>
    )
}

Screenshot of landing page

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda