React Native - Custom Build from fork

1.7k Views Asked by At

I'm sure I'm missing something painfully obvious, but I can't figure out how to use a custom build of React Native.

Here is what I've done so far:

  • Forked React Native from github
  • Made the changes I needed to make to ReactAndroid
  • Ran the gradle assemble task
  • ... Now what?

To clear up why I'm making changes to ReactAndroid and not creating a custom component instead is that I need to update some core functionality to the Network module and can't do that from a custom component.

Part of the problem I'm having trouble proceeding as that I typically would just do a "react-native init" to start a project, and its not completely clear to me what that is doing and how I could possible inject my custom build into that.

I appreciate any pointers in the right direction.

Thanks, Dustin

2

There are 2 best solutions below

2
On BEST ANSWER

Nevermind, found that I was going about it the wrong way, and ReactNative actually does have some documentation around this here: https://facebook.github.io/react-native/docs/building-from-source.

After following those instructions, my changes all worked.

0
On

In my case I had to change the RN dependencies in some modules in their build.gradle files directly.

E.g:

//from 
provided "com.facebook.react:react-native:${_reactNativeVersion}"
//to
compile project(':ReactAndroid')