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
- Host: GitHub
- URL: https://github.com/pysualk/react-console-log-plus-hook
- Owner: PySualk
- License: mit
- Created: 2019-11-15T07:30:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-09T09:16:48.000Z (about 1 year ago)
- Last Synced: 2025-02-15T15:08:18.852Z (3 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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);
```