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

TreeView component does not render properly.

Thread ID:





143758 Apr 4,2019 05:49 AM UTC Apr 5,2019 12:41 PM UTC React - EJ 2 1
Tags: Treeview
Sonam Diwate
Asked On April 4, 2019 05:49 AM UTC

We have scenario here is that:
Fetch data from service.
Change object structure as per TreeView component structure.
Use getderivedstate function to change object structure and then update state
after doing above steps when component start rendering it does not render i have used below component in to render method of react component.

      ref={treeView => workActivities.treeViewComponentObj = treeView}
      cssClass='treeview-external-drag disable-ckeckboxes'

why is the component not reading the change in dataSource and render the component.

Below is the post I was following but i did not got any concreet solution:

Sonam Diwate

Christopher Issac Sunder K [Syncfusion]
Replied On April 5, 2019 12:41 PM UTC

Hi Sonam, 

Greetings from Syncfusion!!! 

We have analyzed your requirement. Could you please let us know the following details. 
  1. How did you change object structure as per TreeView component structure after fetching the data in getderivedstate
  2. Could you please let us know the importance of using getderivedstate in your application rather than updating the state in componentDidMount.

Please check the below sample and modify it as per your application. 

Kindly share any code snippet if possible. It would be more helpful to proceed further. 



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