Print preview is opening in desktop chrome browser but but it is not opening in mobile browsers. It is showing there was a problem with printing the page. If I use this code it is not working in mobile browsers, it is showing the there was a problem with printing page. but it is working in desktop
print() {
var print = window.open("", "", "left=0,top=0,width=800,height=500, scrollbars=1");
var pcontents= this.state.print;
// In this.state.print am getting response from api with html tags like header and paragraph tags
print.focus();
print.document.write(pcontents);
print.document.close();
print.print();
print.close();
}