An open API service indexing awesome lists of open source software.

https://github.com/pysualk/react-console-log-plus-hook

A custom hook for React which allows to use console-log-plus easily in functional components
https://github.com/pysualk/react-console-log-plus-hook

Last synced: 3 months ago
JSON representation

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

Awesome Lists containing this project

README

        

# react-console-log-plus-hook

A custom [hook](https://reactjs.org/docs/hooks-intro.html) for React which allows to use [console-log-plus](https://www.npmjs.com/package/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 (
logger.clp({ type: "info", message: "You clicked me!" })}
>
Click Me!

);
}

const rootElement = document.getElementById("root");
ReactDOM.render(, rootElement);
```