简体   繁体   中英

How to add a Website in a ReactJs responsive web app?

i need help with this problem. My objective is to put a website inside a ReactJs web app. I tried using Iframe of ReactJs, it does not work.

Is there a way to use React Native WebView component inside a ReactJs web app? Or is there a Webview Component in ReactJs

I do want the end user to jump to another tab in order to use the website. i want them to continue to stay in the ReactJs web app and use the website.

The website that i am putting is a.Net website and i am doing a ReactJs project not a React Native Project

simply using iframe should work as this exemple (source below) since your giving an url to this iframe langage doesn't matter if it can be served in http(s)

import React from "react";
import ReactDOM from "react-dom";
class App extends React.Component {
  render() {
    return <iframe src="https://<website>/" />;
  }
}
ReactDOM.render(<App />, document.getElementById("container"));

As said in source the src url should be embeddable to be used inside an iframe if not you can use a reverse proxy to serve this url and change headers

source: https://blog.bitsrc.io/best-practices-in-using-iframes-with-react-6193feaa1e08

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM