Problem updating 3D scene when data changes

Hello we are migrating from VTK 6.0.0 to VTK 8.2.0, and encountering some problems.
We have found that some problems can be fixed like this:
renderer->RemoveActor(act);
act->GetMapper()->Update();
renderer->AddActor(act);
It seems like the wrong way to go to remove the actor and then later add it back. I have tried alternatives such as
renderer->Modified();
act->GetMapper()->GetInput()->Modified();
but they don’t work. Any help would be greatly appreciated.
Thanks

Try to check how Slicer did the posts in the past by looking at the commit history

Thank you for the response. I will study that.
Are there any VTK diagnostics available to help understand why renderer->RemoveActor(act) and then renderer->AddActor(act) are necessary for this fix to work? Presumably these two lines of code change something about the renderer and/or the actor. (I should mention we are using Qt 5.12.10)