spfx banner issue

Aniruddha Aditya 316 Reputation points
2021-02-18T10:37:01.407+00:00

69532-issue.png

I have created an SPFx banner as attached. The issue is that I see multiple banners pops up as SharePoint site at times pulls from the history. When I do a refresh, then the single footer and banner appears.

I would like to know why the issue is and how to get it resolved.

Please refer my attached image.

Thanks

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,249 questions
{count} votes

Accepted answer
  1. Aniruddha Aditya 316 Reputation points
    2021-02-23T13:40:01.873+00:00

    @Amos Wu-MSFT Yes. This issue is resolved. by using a weired code as below
    if (DuplicateChecker == 1) {
    this.renderBanner();
    DuplicateChecker = 2; //This is to stop duplicate banner appearing when page loads from cache
    }
    }

    ·


3 additional answers

Sort by: Most helpful
  1. Aniruddha Aditya 316 Reputation points
    2021-02-19T06:55:26.287+00:00

    @Amos Wu-MSFT .

    I am using Chrome 88.0.4324.150 (Official Build) (64-bit) and IE also. This issue comes when SharePoint loads the page from the history/cache.

    Thanks
    Aniruddha


  2. Aniruddha Aditya 316 Reputation points
    2021-02-19T07:25:31.927+00:00

  3. Amos Wu-MSFT 4,051 Reputation points
    2021-02-19T09:33:00.08+00:00

    HTML code of the header has been printed. You could check the number of times the header HTML code is printed and whether the printed content is the same in the console window of the browser developer tool.
    I suggest you debug on the browser to see if there are logic errors in the code.


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.