I'm trying to fix an issue in React Native, I forked the RN repo, added some code to some java files, and run the rn-tester App, my fix was working fine on the rn-tester App, but when adding this fix to a react-native
package inside node_modules
directory and patching it using patch-package
, my fix not working even if I deleted the node_modules
and installed them again, I see my code inside react-native
java files but it have no effect on the App.
Also, any Log.d
or System.out.println
messages appear on the rn-tester App but don't appear on the other App.
/node_modules/react-native/ReactAndroid/.../somefiles.java
that fixed an RN issue on the rn-tester App.npx patch-package react-native
and inside package.json
file under scripts added "postinstall": "npx patch-package"
.node_modules
and run npm i
./node_modules/react-native/ReactAndroid/.../somefiles.java
and my code existed.npm run android
.Expected
The code fixed the issue on the rn-tester App
so it should fix it on the other App.
Because Rect Native takes its Java dependency as an AAR archive any changes to node modules will be skipped. You need to build react native from source as described here: https://reactnative.dev/contributing/how-to-build-from-source