react-console-log-plus-hook

0.0.2 • Public • Published

react-console-log-plus-hook

[![NPM version][npm-image]][npm-url] [![Dependency Status][daviddm-image]][daviddm-url]

A custom hook for React which allows to use console-log-plus easily in functional components.

How to install

# using npm
> npm install react-console-log-plus-hook --save

# using yarn
> yarn add react-console-log-plus-hook

How to use

import React from "react";
import ReactDOM from "react-dom";

import { useLogger } from "react-console-log-plus-hook";

function App() {
  const logger = useLogger();

  return (
    <button
      onClick={() => logger.clp({ type: "info", message: "You clicked me!" })}
    >
      Click Me!
    </button>
  );
}

const rootElement = document.getElementById("root");
ReactDOM.render(<App />, rootElement);

Package Sidebar

Install

npm i react-console-log-plus-hook

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

2.98 kB

Total Files

5

Last publish

Collaborators

  • pysualk