In a Create React App project, 'load' does not get called again when hot reloading via Command + S.
createSfxHowls() {
// Create a new howl from the audio file's path
const howl = new Howl({
src: mp3Path,
});
// Gets called again correctly after save
console.log("Creating howl...");
// Is supposed to fire when the howl was loaded successfully
howl.once('load', () => {
// Does NOT get called again after save :(
console.log("Created howl!");
});
}
Update:
The following alternative approach works! Would love to understand why?
const howl = new Howl({
src: mp3Path,
onload: () => {
// Gets called again correctly after save :)
console.log("Created howl!");
}
});
In a Create React App project, 'load' does not get called again when hot reloading via Command + S.
Update: The following alternative approach works! Would love to understand why?