When creating balloonContentLayout using templateLayoutFactory :
ymaps.templateLayoutFactory.createClass(` <div> BALLOON </div> `, { build: () => { BalloonContentLayout.superclass.build.call(this); }, clear: () => { BalloonContentLayout.superclass.clear.call(this); } }); Balun is positioned in the upper left corner with empty content, and when you try to close, Uncaught TypeError: Cannot read property 'destroy' of null falls out Uncaught TypeError: Cannot read property 'destroy' of null
But if you do not pass the second argument, then everything works correctly. Where is the mistake?
Jsfiddle example