At the moment we reload canvas by every parent render. It is a good solution to prevent application crashes. Unfortunately, after each render, we need to recreate an instance of the animation class.
It will be good to memoize an animation instance to prevent redundant computations. Also, it will be prettier because the canvas state (current frame, i.e.) will be restored after the rerender (including the page navigation but through the special param, of course).
At the moment we reload
canvasby every parent render. It is a good solution to prevent application crashes. Unfortunately, after each render, we need to recreate an instance of the animation class.It will be good to memoize an animation instance to prevent redundant computations. Also, it will be prettier because the
canvasstate (current frame, i.e.) will be restored after the rerender (including the page navigation but through the special param, of course).