Skip to content

getting 3 console.logs #1

@iqbal125

Description

@iqbal125

I am getting 3 console logs I dont know why. I tried everything hooks/classes inside outside component and it doesnt work.

image

import React, { useEffect, Component } from 'react';
import ContextState from './context_state_config';
import history from './utils/history';
import ReactGA from 'react-ga';
import { observe } from 'react-performance-observer';

ReactGA.initialize('UA-144556525-1');

history.listen((location) => {
    ReactGA.pageview(location.pathname + location.search);
});

var observer = observe(measurements => {
  console.log(measurements);
});

class App extends Component {

  // var observer = new PerformanceObserver(list => {
  //     list.getEntries().forEach(entry => {
  //       // Display each reported measurement on console
  //       if (console) {
  //         console.log("Name: "       + entry.name      +
  //                     ", Type: "     + entry.entryType +
  //                     ", Start: "    + entry.startTime +
  //                     ", Duration: " + entry.duration  + "\n");
  //       }
  //     })
  //   });
  //   observer.observe({entryTypes: ['resource', 'mark', 'measure']});
  //   performance.mark('registered-observer');
  //
  //   function clicked(elem) {
  //     performance.measure('button clicked');
  //   }

  render() {
    return(
      <div>
        React
        <ContextState />
      </div>
    )
  }
}


export default App;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions