SparklineComponent throws 'Nothing was returned from render' error when window is resized.

I'm using the <SparklineComponent /> in a dashboard alongside a <ChartComponent />. The page loads as it's supposed to. But, when I resize it, the `<SparklineComponent />` throws: 'Uncaught error: This usually means a return statement is missing. Or, to render nothing, return null.' 

If I proceed to refresh the page, the error goes away and the dashboard is displayed again with both charts functioning. 


9 Replies

DG Durga Gopalakrishnan Syncfusion Team August 2, 2022 02:43 PM UTC

Hi Benito,


Greetings from Syncfusion.


We have ensured your reported scenario with chart and sparkline component. Control is re-rendered properly while resizing or dragging the dashboard layout panel. We have attached the tested sample and video for your reference.


Video : https://www.syncfusion.com/downloads/support/directtrac/general/ze/SprkDashboard1584860334.zip


Sample : https://stackblitz.com/edit/react-as8q41


Online Demo : https://ej2.syncfusion.com/react/demos/#/bootstrap5/dashboard-layout/dynamic


Kindly revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.



BJ Benito José Suriano August 2, 2022 03:31 PM UTC

Durga,


Thanks for your reply. The problem I'm experiencing occurs when I resize the window, not the chart itself. Please take a look at the attached video. 





BJ Suriano


Attachment: Screen_Recording_20220802_at_11.08.26_AM.mp4_850d6866.zip


DG Durga Gopalakrishnan Syncfusion Team August 3, 2022 02:48 PM UTC

Hi Benito,


We have tried to replicate the reported exception from our end with your attached video; unfortunately, we are unable to replicate an issue, so we request you to share the following information which will be helpful for further analysis and provide you the solution.

  • Try to reproduce the reported scenario in already shared sample.
  • Please share a simple standalone sample.
  • Share the details if you have done any other customization in your sample.
  • Share your package version.


Kindly revert us if you have any concerns.


Regards,

Durga Gopalakrishnan.



BJ Benito José Suriano August 11, 2022 02:05 AM UTC

Hi Durga, I got to the end of my exercise and the instructor pointed out the origin of that error. See the following video as reference. https://www.youtube.com/watch?v=jx5hdo50a2M&t=13256s


He noted that the error goes away by following the instruc



DG Durga Gopalakrishnan Syncfusion Team August 11, 2022 03:10 PM UTC

Hi Benito,


We are not clear about your exact query, since an initially reported issue is related to sparkline component which throws console exception while resizing the browser window. But now, an attached video seems to be chart.


Please mention in which control you are facing the problem and kindly share the replication steps to reproduce an issue or sample to analyze this case further from our end.


Regards,

Durga Gopalakrishnan.



IE iEarl October 23, 2022 08:28 AM UTC

Hey,

I got the same issue just now and I don't know how this error will be solve I tried every possible way but it's still causing me some problems here is a sample video of the error

The video


Attachment: VIDEO_ERROR_4fb9701d.zip



DG Durga Gopalakrishnan Syncfusion Team October 26, 2022 02:39 PM UTC

Hi Ieari,


We have tried to replicate the reported problem; unfortunately, we are unable to reproduce an issue. We request you to share an issue reproduced sample to validate this case from our end.


Sample : https://stackblitz.com/edit/react-as8q41


Please let us know if you have any concerns.


Regards,

Durga Gopalakrishnan.



KE Kareem Ezzat December 7, 2022 04:14 AM UTC

The Solution is to use "Class Component" and extends "React.PureComponent"

Do NOT use functional components

ss.png



DG Durga Gopalakrishnan Syncfusion Team December 20, 2022 02:53 PM UTC

Hi Kareem,


We have prepared sample based on your requirement. Sparkline control is rendered properly with class component extends pure component. Please check with the below screenshot and sample.



Sample : https://stackblitz.com/edit/a-purecomponent-example-pu1uey


Please let us know if you have any concerns.


Regards,

Durga Gopalakrishnan.


Loader.
Up arrow icon