Skip to content

Latest commit

 

History

History
52 lines (37 loc) · 939 Bytes

README.md

File metadata and controls

52 lines (37 loc) · 939 Bytes

babel-plugin-wrap-profiler

A Babel plugin that wraps components with Profiler.

Usage

Install

For Yarn

yarn add -D babel-plugin-wrap-profiler

For npm

npm install --save-dev babel-plugin-wrap-profiler

Configure Babel

// In your .babelrc
{
    "plugins": [
        "babel-plugin-wrap-profiler"
    ]
}

Log Profiler Results

// In your code
import React from 'react';
import { logComponents } from "babel-plugin-wrap-profiler/lib/profiler-utils";


const Component = () => {
    return (
        <button onClick={logComponents}>
            Log Components
        </button>
    );
};

Credits