# ReactParser

**Kind:** Class

**Source:** [`atloria-monorepo/libs/parser-core/src/parsers/frontend/react.parser.ts`](https://github.com/sherkety/atloria/blob/main/atloria-monorepo/libs/parser-core/src/parsers/frontend/react.parser.ts#L95)

React Parser - Pure class implementation (no NestJS dependencies)

Works for both CLI (static) mode and cloud mode.

**Implements:** `IParser`

## Methods

| Method | Signature | Returns |
|---|---|---|
| `initialize` | `initialize(config: ParserConfig)` | `Promise<void>` |
| `canParse` | `canParse(filePath: string)` | `boolean` |
| `parseFile` | `parseFile(filePath: string, content: string)` | `Promise<ParseResult>` |
| `parseFiles` | `parseFiles(files: ParseFileInput[])` | `Promise<ParseResult[]>` |
| `destroy` | `destroy()` | `Promise<void>` |

## Properties

| Property | Type |
|---|---|
| `name` | `string` |
| `version` | `string` |
| `supportedPatterns` | `string[]` |

## Where it refuses work

- `ReactParser` stops the work with an early return when `!t.isJSXAttribute(attr)`, in 4 places.
- `ReactParser` stops the work with an early return when `!attrName`, in 4 places.
- `ReactParser` stops the work with an early return when `!name`, in 3 places.
- `ReactParser` stops the work with an early return when `!/^[A-Z]/.test(name)`, in 2 places.
- `ReactParser` stops the work with an early return when `!label`, in 2 places.
- `ReactParser` stops the work with an early return when `!this.canParse(filePath)`.

## When something fails

- `ReactParser` handles failure in 2 places: it turns it into a return value in all 2.
