admin管理员组文章数量:1394396
I have a React Native app developed with Expo, and it includes a Map component that renders a Leaflet map inside a WebView (for mobile).
For the web version (Map.web.tsx
), I’m trying to use react-leaflet
, but I run into the following error when browsing the app:
Static Rendering Error (Node.js)
window is not defined
I discovered that disabling static rendering in app.json resolves the issue:
{
"expo": {
...
"web": {
"bundler": "metro",
"output": "single" // changing "static" to "single"
}
}
}
However, I don’t want to disable static rendering for my entire app, but only for the /map route.
My question:
Is there a way to selectively disable static rendering for a specific route in Expo Web? Or do I have to give it up for all routes?
Any guidance or workarounds would be greatly appreciated
本文标签: Is it possible to use react leaflet in expo web static renderingStack Overflow
版权声明:本文标题:Is it possible to use react leaflet in expo web static rendering? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744665080a2618479.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论