Open vandervidi opened 6 years ago
If you are using webpack, you can add an alias to the configuration
module.exports = {
resolve: {
alias: { soundmanager2: 'soundmanager2/script/soundmanager2-nodebug-jsmin.js' }
}
};
or just do the setup inside your sound component:
// inside YourReactSoundComponent.jsx
import Sound from 'react-sound';
and inside the constructor, set the debug option to false
constructor() {
super();
soundManager.setup({ debugMode: false });
}
I hope this help. You can find more details in #13.
it's
import Sound, { soundManager } from 'react-sound';
soundManager.setup({ debugMode: false });
and that doesn't work either. Why not just disable console logging by default? This the only lib i've ever had the (dis)pleasure of working with that does this.
Seriously @leoasis, how can we stop this???
5992dfc should have fixed this. Messages should be suppressed in production builds of your React project.
for me what worked was simply putting this on my App.tsx (I'm using typescript)
(window as any).soundManager.setup({debugMode: false});
And if you are not using typescript you could simply set:
window.soundManager.setup({debugMode: false});
I'm happy to accept a PR that configures soundmanager to have debugMode set to false when it starts in development, and to update the documentation to specify how to set it up
How to stop logs in console?