We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Uncaught TypeError: Cannot read property 'className' of undefined

Thread ID:





149192 Nov 18,2019 10:27 AM UTC Jan 14,2020 12:29 PM UTC React - EJ 2 6
Tags: DocumentEditor
Asked On November 18, 2019 11:28 AM UTC

I encountered a problem when I try to conditionally render some of your components: SwitchComponent, TextBoxComponent (maybe others too, haven't tried).

We are using redux and fetching some data over API. When data is loading we are displaying loader and when the data is fetched, I want to display a form including components mentioned above.

I can also reproduce the problem with code below:

Error inside console:

Any ideas how to resolve this?

Dependency versions:

Noticed the issue here: Switch component gets rendered the first time and on next re-render it's removed since loading is true. This is when the error is triggered.

Arunkumar Devendiran [Syncfusion]
Replied On November 20, 2019 02:44 AM UTC

Hi Nejc, 
Thank you for contacting Syncfusion support. 
Before we start to work on this, we would like to know the following details,            
1. Could you please confirm us in which case you are trying to destroy the switch? 
             2. If possible, please provide the issue replicated sample. 
Could you please ensure the above details and get back to us with more information. The information provided would be great help for us to resolve your issue. 
Arunkumar D 

Replied On December 10, 2019 11:28 AM UTC


I think we have the same problem in our enviroment (react-rouer/redux). If I switch the page by react-router the component is working, but if I refresh the page I will get an error for every ej2 react component:

Uncaught TypeError: Cannot read property 'className' of undefined at removeClass at SwitchComponent, DocumentEditor and more ...

The error is called in the destroy function under ej2-react-base.

EDIT: I have found a similar ticket under https://www.syncfusion.com/feedback/9901/how-to-solve-uncaught-typeerror-cannot-use-in-operator-to-search-for-eventlist-in. Is this fixed or planed in a new release?

Harini Chellappa [Syncfusion]
Replied On December 12, 2019 01:54 PM UTC

Hi Christian,


We are currently validating the reported scenario. Will update more details on this by Dec 16, 2019.



Harini C 

Harini Chellappa [Syncfusion]
Replied On December 16, 2019 05:51 PM UTC

Hi Christian,


When navigating or refreshing the page, are you calling any refresh API or destroy API of the component?


When switching, will you create and destroy the components? Can please share the scenario to reproduce this console error in detail, so that we can check further and provide solution.



Harini C

Replied On January 13, 2020 11:00 AM UTC

Hi Harini,

sorry for the long time with no answer.

I'm not calling any API's or something only the document editor.
You will find the files in the appendix with error images.

Best regards,

Attachment: files_ee60a4df.zip

Suriya Murugan [Syncfusion]
Replied On January 14, 2020 12:29 PM UTC

Hi Chris, 
Thanks for sharing the information. 
Currently, we are validating the provided details and update you more details on or before January 20,2020. 
Suriya M. 


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon