Would love to see the measure function as a decorator:
class MyComponent extends React.Component {/* ... */}
export default ReactPerformance.measure({
getId: 'some_recognizable_identifier',
Component: MyComponent,
isCollapsed: false,
})
Would look good as
import {measure} from 'react-performance'
@measure({
getId: 'some_recognizable_identifier',
isCollapsed: false,
})
export default class MyComponent extends Component {/* ... */}
And with redux...
@measure({getId: 'some_recognizable_identifier'})
@connect(mapStateToProps, mapDispatchToProps)
class MyComponent extends React.Component {/* ... */}
This syntax would make react-performance easier to play around with because it would involve less changes to the code, ie you would only need to decorate components which would make it easier to add and remove profiling.
Would love to see the measure function as a decorator:
Would look good as
And with redux...
This syntax would make react-performance easier to play around with because it would involve less changes to the code, ie you would only need to decorate components which would make it easier to add and remove profiling.