hoaiduyit/react-pannellum

onPanoramaLoaded is broken

Closed this issue · 0 comments

m-bp commented

Hi again.

At the moment the component throws a TypeError: Cannot read property 'on' of null whenever onPanoramaLoaded is used.

If I had to guess it's because the new code for the different panorama types inits the viewer in the setState callback. Which means by the time the onPanoramaLoaded is called the init function hasn't been called yet, as it runs asynchronously.