'How to display Add in version in label on taskpane office js react?

I have developed an office js add-in that Releases many versions format of EA..... EA stands for Excel Add-in to distinguish it from other projects. For example: let’s start with EA.22.1.0.0.

It’ll also be nice to have a small label on the add-in side panel indicating the version. If the user runs into issues, we’ll know the version they are running. I have already mentioned a version manifest.xml file but i don't know how to display dynamic version label on task pane

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <OfficeApp xmlns="http://schemas.microsoft.com/office/appforoffice/1.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0" xmlns:ov="http://schemas.microsoft.com/office/taskpaneappversionoverrides" xsi:type="TaskPaneApp">
      <Id>977f879a-4c0c-41f9-828b-b2fa6142b085</Id>
      <Version>EA.22.1.0.0</Version>
      </OfficeApp>


Solution 1:[1]

You may consider defining the version variable in the codebase, so you could update the version and display it on the side panel.

The Version element specifies the version of your Office Add-in. The version number can be 1, 2, 3, or 4 parts (i.e., n, n.n, n.n.n, or n.n.n.n). Each part of the version number can be a maximum of 5 digits.

<Version>n[.n.n.n]</Version>

This is the version of the specific add-in. If a developer updates something in the manifest, the version must be incremented as well. This way, when the new manifest is installed, it will overwrite the existing one and the user will get the new functionality. If this add-in was submitted to the store, the new manifest will have to be re-submitted and re-validated. Then, users of this add-in will get the new updated manifest automatically in a few hours, after it is approved.

Solution 2:[2]

Your manifest contains the URL for the task pane. Simply add the version number into the url - e.g. https://example.com/mytaskpane.html#EA.22.1.0.0

Your taskpane can then display that (var hash = window.location.hash.substr(1)) however it likes.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 cnd