getReactContext

Return

The ReactContext associated to the View received as a parameter.

We can't rely that the method View.getContext() will return the same context that was passed as a parameter during the construction of the View.

For example the AppCompatEditText class wraps the context received as a parameter in the constructor of the View into a TintContextWrapper object. See: https://android.googlesource.com/platform/frameworks/support/+/dd55716/v7/appcompat/src/android/support/v7/widget/AppCompatEditText.java#55