Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

69
Vistas
Copy array of data to clipboard

I have a Flask back-end and a React front-end. At some point data is sent from back-end to front-end where the data is used for several things. Either way, when the data comes from the back-end to the front-end I just save it as follows when the page loads:

const [data, setData] = useState[]

useEffect(() => {
    setData(<data from backend>);
}, []);

Hence, my data should now be stored as data. And data here is just an array of numbers/values. Now I would like to just click a button or something, and then copy the data to the clipboard, where I can then paste it into Excel or something.

I just can't seem to find any good solution to this. So I was wondering how this is done, and if it is even possible without writing 100 lines of code ?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can set the clipboard text with :

navigator.clipboard.writeText(data)

and you can set onClick event or set that in defined useEffact hook after fetching data.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda