# TS2628: Cannot assign to '…' because it is an enum.

> An enum's name is used as an assignment target. Enums can't be reassigned; assign to a variable instead.

## What it means

The left side of the assignment is an enum declaration. An enum is a fixed set of values and its
name can't be rebound.

## Example

```ts
enum Mode { On, Off }
Mode = Mode;
export {};
```

## How to fix

- Use a variable of the enum type: `let mode: Mode = Mode.On; mode = Mode.Off;`.

Source: https://ts-r.dev/errors/TS2628/
