Destroy widgets in single page app


I’m currently using a custom component to embed timelines into our single page app, basically it runs

    twttr.ready(() => {
        sourceType: 'profile',
        screenName: this.screenName
      }, this.elem.nativeElement);

on the element of the component, however, after a page change twitter throws:

Uncaught TypeError: Cannot read property 'classList' of null
    at Object.u [as present] (
    at t.hasRootClass (
    at t.recalculateBreakpoints (
    at t.<anonymous> (
    at t.<anonymous> (
    at t.resize (
    at t.<anonymous> (
    at t.loadNewTweets (

It seems there is no destroy method to let the library know that the container has been removed from the dom right? Any idea?

Timeline Widget not destroyed on single page application page change SPA

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.