WA

Warning

warning

A mirror of Facebook's Warning

Utilities
warning
facebook
react
invariant
Utilities
javascript
npm
frontend
open source
ui
Stars
221
Weekly
16M
Open issues
1
Bundle
~15 kB

Installation

npm install warning

Code example

import { useWarning } from "warning";

export function Example() {
  const value = useWarning();
  return <p>{String(value)}</p>;
}

Pros & cons

Pros

  • Actively maintained by Berkeley Martinez
  • 16M weekly downloads. Battle tested
  • MIT licensed

Considerations

  • Adds roughly ~15 kB to your bundle
  • Needs client-only rendering in SSR frameworks
  • Not supported in React Native
  • 1 open issues on GitHub

FAQs

Alternatives & similar libraries