React App Crashes When a certain Component Rendered

1.4k Views Asked by At

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. It works fine until I am clicking on a MODAL or some button that changes TAB without changing routes. 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. Images to make it clearer:

enter image description here

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: enter image description here

A blank page. So, without using google-translate-widget all is working without a problem. 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.

1

There are 1 best solutions below

2
On BEST ANSWER

I got the component which cause the insertBefore error inside span tag. It solved the issue.