The spectrogram component uses default values for AudioModel, RenderCanvasSize, and RenderWindow so that if we query these values while the spectrogram hasn't been rendered yet, we don't get undefined or null.
However, this is incorrect and has led to bugs, and performance degradations as we sometimes double render some components (once before the spectrogram has rendered, and again after).
We should therefore use null or undefined as default values so that we can correctly handle a null value, reduce erroneous render cycles, and create more resilient code.
This is a separate issue from the Refactoring Epic as this change will have large reaching consequences about null checking, conditional rendering, and partial re-renders
The spectrogram component uses default values for
AudioModel
,RenderCanvasSize
, andRenderWindow
so that if we query these values while the spectrogram hasn't been rendered yet, we don't getundefined
ornull
.However, this is incorrect and has led to bugs, and performance degradations as we sometimes double render some components (once before the spectrogram has rendered, and again after).
We should therefore use
null
orundefined
as default values so that we can correctly handle a null value, reduce erroneous render cycles, and create more resilient code.This is a separate issue from the Refactoring Epic as this change will have large reaching consequences about null checking, conditional rendering, and partial re-renders