---
url: /docs/guide/usage/linter/rules/react/invariant.md
---

### What it does

Reports internal React Compiler invariant violations. These indicate a
bug in the compiler itself, not in your code — consider reporting them
to the oxc or React teams.

Powered by the React Compiler, which runs once per file and is shared
with the other React Compiler rules. Port of
`react-hooks/invariant`.

### Why is this bad?

An invariant violation means the compiler's internal state is
inconsistent; the affected function is skipped rather than optimized.

## How to use

## Version

This rule was added in v1.79.0.

## References
