Leaflets.js 621 B

123456789101112131415161718192021222324
  1. import React, {Profiler} from "react";
  2. import Leaflet from "./../Leaflet";
  3. import {measureTime} from './../helpers/measureTime';
  4. export default class Leaflets extends React.Component{
  5. constructor(props) {
  6. super(props)
  7. this.metricsRef = React.createRef()
  8. }
  9. render(){
  10. return (
  11. <div>
  12. <div ref={this.metricsRef} className="mapTime" >
  13. </div>
  14. <Profiler id="leaflet" onRender={measureTime(this)}>
  15. { Array.from({length:30}, (_, index) =>
  16. <Leaflet key={index}/>
  17. )}
  18. </Profiler>
  19. </div>
  20. );
  21. }
  22. }