# react-diagnostics

> Diagnostics for React components

Latest version **1.0.2** (published 2023-11-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-diagnostics
pnpm add react-diagnostics
yarn add react-diagnostics
bun add react-diagnostics
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2023-11-13 |
| First published | 2023-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14.0.0 |
| Dependencies | 1 |
| Unpacked size | 8.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Jarrett Huang |
| Maintainers | jarretthuang |
| Keywords | react, performance, diagnostics |

## Links

- npm: https://www.npmjs.com/package/react-diagnostics
- Repository: https://github.com/jarretthuang/react-diagnostics
- Homepage: https://github.com/jarretthuang/react-diagnostics#readme
- Issues: https://github.com/jarretthuang/react-diagnostics/issues
- npm.io page: https://npm.io/package/react-diagnostics

## Dependencies (1)

- [object-sizeof](https://npm.io/package/object-sizeof.md) ^2.6.3

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2023-11-13
- 1.0.1 — 2023-11-12
- 1.0.0 — 2023-11-12

## README

# React Diagnostics

Enhance your React component development experience with diagnostic logging.

## Installation

```bash
npm install --save-dev react-diagnostics
```

## Usage

#### Simple Diagnostics

Use `withDiagnostics.simple()` for basic diagnostic logging.

```jsx
import withDiagnostics from "react-diagnostics";

const MyComponent = (props) => {
  // Your component logic here
};

export default withDiagnostics.simple(MyComponent);
```

#### Detailed Diagnostics

For more detailed diagnostics, use `withDiagnostics.detailed()`.

```jsx
import withDiagnostics from "react-diagnostics";

const MyComponent = (props) => {
  // Your component logic here
};

export default withDiagnostics.detailed(MyComponent);
```

#### Custom Configuration

Customize the diagnostics behavior with `withDiagnostics.config()`.

```jsx
import withDiagnostics from "react-diagnostics";

const MyComponent = (props) => {
  // Your component logic here
};

const customConfig = {
  logPropsSize: true,
  logExecutionTime: true,
  devModeOnly: true,
};

export default withDiagnostics.config(customConfig)(MyComponent);
```

## Example

Check out the "demo" folder in this repository.
Run `npm start`, and open the console to see the logs in action.

### License

Copyright @[Jarrett Huang](https://github.com/jarretthuang), under the [MIT License](https://github.com/jarretthuang/json-viewer/blob/main/LICENSE).

---
_Source: https://npm.io/package/react-diagnostics · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
