0

I'm wondering how can i measure performance of a map loop inside jsx in react, this is what i've tried so far


{
{stations.map((station: Station) => {
       start = performance.now();
       return (
                <Marker
                  key={station.id}
                />
              );
        end = performance.now(); //unreachable code
})}

But the last line of code is not reachable , the problem is i don't understand how to put multiline of code inside jsx brackets in return statement of a component

Zero0
  • 371
  • 4
  • 15

0 Answers0