简体   繁体   English

渲染某个组件时 React App 崩溃

[英]React App Crashes When a certain Component Rendered

To be honest, I don't know what really causes the problem but will try to explain it.老实说,我不知道真正导致问题的原因,但会尝试解释。 In my react app, I have placed a Google Translate Widget (which is retired some years ago) to easily translate whole website in just a click.在我的 React 应用程序中,我放置了一个 Google 翻译小部件(几年前已停用),只需单击一下即可轻松翻译整个网站。 It works fine until I am clicking on a MODAL or some button that changes TAB without changing routes.它工作正常,直到我单击 MODAL 或某个按钮来更改 TAB 而不更改路线。 I mean, when routing there is no problem but if new component renders in the same route (like it does in MODAL and TAB component), the app crashes and all I am getting is a blank page.我的意思是,路由时没有问题,但如果新组件在同一路由中呈现(就像在 MODAL 和 TAB 组件中一样),应用程序崩溃,我得到的只是一个空白页面。 Images to make it clearer:图片使其更清晰:

在此处输入图像描述

As it seems, Google translated page to French in homepage here is a different route and everything seems OK.看起来,谷歌将主页中的页面翻译成法语是一条不同的路线,一切似乎都很好。 BUT when I click on Make a Reservation Button (which is the vertical one) or All Features button (which is the black one at the bottom), distressingly this is what I get:但是,当我点击“预订按钮”(垂直按钮)或“所有功能”按钮(底部黑色按钮)时,令人沮丧的是,这就是我得到的: 在此处输入图像描述

A blank page.空白页。 So, without using google-translate-widget all is working without a problem.因此,在不使用 google-translate-widget 的情况下,一切都没有问题。 But if the page is translated and user clicks on a button renders some component on the same route this happens.但是如果页面被翻译并且用户点击一个按钮在同一路径上渲染一些组件,就会发生这种情况。 ANY solution suggestion or comment means so much to me.任何解决方案建议或评论对我来说意义重大。 Thank you.谢谢你。

I got the component which cause the insertBefore error inside span tag.我得到了导致 span 标记内的 insertBefore 错误的组件。 It solved the issue.它解决了这个问题。

暂无
暂无

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

相关问题 错误:文本字符串必须在<text>字符串不为空时 React Native 中的组件</text> - Error: Text strings must be rendered within a <Text> component in React Native when string is not empty 为什么在使用 React Router V6 保护路由时,我使用 AWS Amplify 的 React Authentication 组件会被无限渲染 - Why is my React Authentication component using AWS Amplify being rendered infinitely when using React Router V6 to protect routes 尝试使用本机反应将图像上传到 firebase 存储时,应用程序在 iOS 上崩溃 - App crashes on iOS when trying to upload image to firebase storage using react native react-native 应用程序在没有登录的情况下崩溃 Firebase 使用带有“where”查询和“in”运算符的“onSnapshot”时身份验证注销 - react-native app crashes without log on Firebase auth logout when using 'onSnapshot' with 'where' query and 'in' operator 将图像发送到 Firebase 存储时应用程序崩溃 - App crashes when sending image to Firebase storage 从 google firestore -Quiz 应用程序获取问题时应用程序崩溃 - App crashes when fetch questions from google firestore -Quiz app 从 viewModel 调用注销 function 时应用程序崩溃 - App crashes when signout function is invoked from viewModel 当我按下“继续”按钮时应用程序崩溃(在活动之间转换) - App crashes when I press "continue" button (transitioning between activities) Android 工作室应用程序在关闭图像裁剪活动时崩溃 - Android studio app crashes when closing image crop activity iOS 应用程序在尝试使用 Firebase 身份验证“使用 Apple 登录”时崩溃 - iOS app crashes when trying to "Sign in with Apple" using Firebase Authentication
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM