How to use React Profiler on Forge Apps


I am trying to use React Profiler on a Forge App, but can’t make it work.
I have no error messages, just that the callback is never called.
To be sure that it was not coming from my App, I tried it with the ‘Hello World’ Jira app. Same problem.
Here is the code:

import React, { Profiler } from 'react';
import ForgeReconciler, { Text } from '@forge/react';

const App = () => {
  return (
      <Text>Hello world!</Text>

const logTimes = (id, phase, actualTime, baseTime, startTime, commitTime) => {
  console.log(`${id}'s ${phase} phase:`);
  console.log(`Actual time: ${actualTime}`);
  console.log(`Base time: ${baseTime}`);
  console.log(`Start time: ${startTime}`);
  console.log(`Commit time: ${commitTime}`);

    <Profiler id="App" onRender={logTimes}>
      <App />

Any idea? Thanks for your help!

1 Like