Skip to content

Temporarily prevent rerendering of the components #2494

Answered by urugator
BlackWild asked this question in General
Discussion options

You must be logged in to vote

Also I think the second solution

I think you just have to immediately update the value in addition to sending it to server.

onValueChange={(value) => {
  // update both server and local
  data.value = value;
  data.localValue = value;   
  sendValueToServer(value);
}}

Therefore the synced value is always up to date, unless server says otherwise on next sync - meaning the value was updated by other client and the jump is practically unavoidable.

Additionally (and regardless of solution I think) you will need to associate a timestamp with each update and ignore the server value in case it's older then the current one.

I would suggest to leave the untracked as a last option.

Replies: 5 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by BlackWild
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2494 on October 07, 2020 08:23.