---
category: protocols
slug: /protocol/patch
title: "Patch Protocol"
description: How patch dependencies work in Yarn.
---

The `patch:` protocol applies a patch to the package source. This is useful for applying bug fixes that have not yet been merged into the main package source.

```
yarn add @types/react@patch:@types/react@18.0.0#./my-patches/react-types.patch
```

## Generating a patch

Patches are meant to be generated by the [`yarn patch`](/cli/patch) workflow rather than created manually.

Check the [patching documentation](/features/patching) for all details.
