Skip to content

Chart JS displays data properly only on the second refresh of the page #794

Answered by onemanwenttomow
gregorsart asked this question in Web
Discussion options

You must be logged in to vote

So having just spoken with the group in person it turns out there were 2 issues.

  1. The cache needed to be emptied.
  2. There was a use of splice (which mutates) rather than slice (which creates a copy) that was also causing an issue.

The demo above works (in that there is no need to use useEffect to sync up states).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@gregorsart
Comment options

@gregorsart
Comment options

@onemanwenttomow
Comment options

Answer selected by onemanwenttomow
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Web
Labels
None yet
2 participants