首页 > 解决方案 > 在反应中使用 iframe 显示本地 html 文件

问题描述

如何让 iframe 显示来自 React 组件的本地 html 文件。我的问题是,当我指向我的语言环境 html 文件时,反应路由器会接收请求并重定向到主页。所以 iframe 显示主页而不是静态 html 页面。

标签: reactjsiframe

解决方案


try moving the HTML file to the Public folder, and then put "./yourfile.html" as the source for the iframe. though i dont know if this is the best practice or not, but it solves my problem.


推荐阅读