简体   繁体   English

如何在 ReactJs 响应式 web 应用程序中添加网站?

[英]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.我的目标是将网站放在 ReactJs web 应用程序中。 I tried using Iframe of ReactJs, it does not work.我尝试使用 ReactJs 的 Iframe,它不起作用。

Is there a way to use React Native WebView component inside a ReactJs web app?有没有办法在ReactJs web 应用程序中使用 React Native WebView 组件? Or is there a Webview Component in ReactJs或者 ReactJs 中是否有Webview组件

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.我希望他们继续留在 ReactJs web 应用程序中并使用该网站。

The website that i am putting is a.Net website and i am doing a ReactJs project not a React Native Project我放置的网站是一个.Net 网站,我正在做一个 ReactJs 项目而不是 React Native 项目

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)只需使用 iframe 就可以作为这个例子(来源如下),因为你给这个 iframe 语言提供 url 是否可以在 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如源代码中所述,src url 应该嵌入到 iframe 中,如果不是,您可以使用反向代理来提供此 url 并更改标头

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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