I found a simple solution, react-router
works fine after this change. We can backup the functions before Office.js
nullifies them in index.html
, and then restore:
<script>
window.backupHistoryFunctions = {};
window.backupHistoryFunctions.pushState = window.history.pushState;
window.backupHistoryFunctions.replaceState = window.history.replaceState;
</script>
<!-- Office JavaScript API -->
<script type="text/javascript" src="https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js">
</script>
<script>
window.history.pushState = window.backupHistoryFunctions.pushState;
window.history.replaceState = window.backupHistoryFunctions.replaceState;
console.log(window.history.replaceState)
</script>
As the Microsoft rep notes, this would be incompatible with Excel, but I guess it'd be fine for a mail add-in.