A couple weeks ago, I updated a package. expo-router to be specific.
For some reason nobody wanted to merge a simple fix for a console warning that keeps appearing incorrectly.
When this happens you have a few options
Use a different module
This isn’t ideal unless you are using a very simple npm package, but it’s something you can do if alternatives exist.
Patch the current package
Doing this in 2023 is incredibly easy, some package managers even have built in support. To keep this short and simple, I’ll just explain how to use the patch-package npm module.
If you are using yarn 1:
yarn add patch-package postinstall-postinstall
npm:
// add this to package.json
"scripts": {
"postinstall": "patch-package"
}
// then
npm i patch-package
Yarn 2:
Use yarn-patch natively: https://yarnpkg.com/cli/patch
Patching Expo Router
For this problem, someone found the exact location of the problem and made a PR, it just didn’t get merged when I needed it fixed. They left a comment here.
Keep reading with a 7-day free trial
Subscribe to zach.codes to keep reading this post and get 7 days of free access to the full post archives.