This is a migrated thread and some comments may be shown as answers.

Sparkline does not update

1 Answer 70 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Onur
Top achievements
Rank 1
Onur asked on 15 Oct 2019, 03:23 PM

Hi,

i am using latest React.

 

inside render():

<Sparkline data={this.state.sparklineData} />

and do update the state via 

this.setState({sparklineData:sparkData})

All components do update except Sparkline. I have tried many things like this.forceUpdate(). Also debugged the this.state.sparklineData inside render(). The setState does the work and re-renders and the data comes through. console.log(this.state.sparklineData) proves it.

But the component simply doesnot re-render.  I have put a default value into sparklineData which is:

this.state = {

    sparklineData: [1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1,1,0,1,0,0,1],

}

and this WILL be rendered. After that no updates. Please help

 

1 Answer, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 16 Oct 2019, 11:40 AM

Hi Onur,

You are correct. I also reproduced the same behavior on my side.

We consider this as an issue and it is already logged. You can find it here: https://github.com/telerik/kendo-react/issues/357. I updated your Telerik Points. Thank you for bringing this to our attention!

A possible workaround at the moment is to add key prop of the Sparkline and update it's value as shown in this demo: https://stackblitz.com/edit/react-h8aze4-j9atax?file=app/main.jsx.

I hope this will help you. Please don't hesitate to contact us in case other questions arise.

Best Regards,
Silviya
Progress Telerik

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Onur
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Share this question
or