# TS2630: Cannot assign to '…' because it is a function.

> A function declaration's name is used as an assignment target. Use a variable holding the function if it needs to change.

## What it means

The left side of the assignment is a function declaration. Its name can't be rebound in
TypeScript.

## Example

```ts
function log() {}
log = () => {};
export {};
```

## How to fix

- Declare it as a variable when it needs to be replaceable: `let log = () => {};`.
- Or give the replacement its own name.

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