Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to export React single page website as HTML?

I have a single page web application using React and materialize-css and I would like to export it as static HTML and CSS so that it is possible to easily edit HTML for the purpose of prototyping. Is it possible to export at least a snapshot of current state?

I tried "save page" in Firefox and Chrome, but it does not provide good results.

like image 356
Marcin Avatar asked May 05 '17 09:05

Marcin


1 Answers

  var pageHTML = window.document.getElementById('divToPDF').innerHTML;
  let data = new Blob([pageHTML], {type: 'data:attachment/text,'});
  let csvURL = window.URL.createObjectURL(data);
  let tempLink = document.createElement('a');
  tempLink.href = csvURL;
  tempLink.setAttribute('download', 'Graph.html');
  tempLink.click();
like image 168
zakaria mahmud Avatar answered Oct 15 '22 06:10

zakaria mahmud