简体   繁体   中英

React app does not render inside Facebook instant game iframe

I have a react app which does not render when zipped and loaded into facebook instant game platform. It generates logs such as below, that clearly show that the actions are firing. See the logs with Middleware ACTION-NAME below.

If someone can give me ideas on what could be going wrong, that would be great. Does JSX in an iframe need some special permissions to write to the #root tag?

在此处输入图片说明

I solved it thus,

I am using BrowserRouter in react for navigation. I had to change the route path I wanted to load initially from / to * .

-                <Route exact path="/">
+                <Route exact path="*">

It seems like initially, when running the game inside the iframe, the route path did not match / .

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