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.patchGenerating a patch
Section titled “Generating a patch”Patches are meant to be generated by the yarn patch workflow rather than created manually.
Check the patching documentation for all details.