Repository: parse-community/Parse-SDK-JS (js)

Issue:
`TypeError: undefined is not an object` with React Native v0.64 (EventEmitter)
### New Issue Checklist
<!-- Please check the following boxes [ ] -> [x] before submitting your issue. Click the "Preview" tab for better readability. Thanks for reporting this issue! -->

- [x] I am not disclosing a [vulnerability](https://github.com/parse-community/parse-server/blob/master/SECURITY.md).
- [x] I am not just asking a [question](https://github.com/parse-community/.github/blob/master/SUPPORT.md).
- [x] I have searched through [existing issues](https://github.com/parse-community/Parse-SDK-JS/issues?q=is%3Aissue).
- [x] I can reproduce the issue with the latest versions of [Parse Server](https://github.com/parse-community/parse-server/releases) and the [Parse JS SDK](https://github.com/parse-community/Parse-SDK-JS/releases). <!-- We don't investigate issues for outdated releases. -->

### Issue Description
<!-- What is the specific issue? -->

#### Versions 
- React Native: 0.64
- Parse: 3.1.0

I get a error from metro bundler when I run iOS as below

```js
 ERROR  TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "../../../react-native/Libraries/vendor/emitter/EventEmitter").prototype.addListener')
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. 
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. 
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
```

I think the error is related to 
`node_modules/parse/lib/react-native/EventEmitter.js`

```js
var EventEmitter = require('../../../react-native/Libraries/vendor/emitter/EventEmitter');

EventEmitter.prototype.on = EventEmitter.prototype.addListener;
module.exports = EventEmitter;
```


### Steps to reproduce
<!-- How can someone else reproduce the issue? -->
Build iOS with react native 0.64

### Actual Outcome
<!-- What outcome, for example query result, did you get? -->

.

### Expected Outcome
<!-- What outcome, for example query result, did you expect? -->

Run without error

###  Environment
<!-- Be specific with versions, don't use "latest" or semver ranges like "~x.y.z" or "^x.y.z". -->

Client
- Parse JS SDK version: `3.1.0`

### Logs
<!-- Include relevant logs here. Turn on additional logging by configuring VERBOSE=1 in your environment. -->

```sh
 ERROR  TypeError: undefined is not an object (evaluating '_$$_REQUIRE(_dependencyMap[0], "../../../react-native/Libraries/vendor/emitter/EventEmitter").prototype.addListener')
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. 
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
 ERROR  Invariant Violation: Module AppRegistry is not a registered callable module (calling runApplication). A frequent cause of the error is that the application entry file path is incorrect. 
      This can also happen when the JS bundle is corrupt or there is an early initialization error when loading React Native.
```

Pull request:
fix EventEmitter undefined on React Native 0.64
fixes #1335 

Patch:
diff --git a/src/EventEmitter.js b/src/EventEmitter.js
index 47d6a1c..d45ec6b 100644
--- a/src/EventEmitter.js
+++ b/src/EventEmitter.js
@@ -10,7 +10,7 @@
  */
 
 if (process.env.PARSE_BUILD === 'react-native') {
-  const EventEmitter = require('../../../react-native/Libraries/vendor/emitter/EventEmitter');
+  const EventEmitter = require('../../../react-native/Libraries/vendor/emitter/_EventEmitter');
   EventEmitter.prototype.on = EventEmitter.prototype.addListener;
   module.exports = EventEmitter;
 } else {


Test patch:
diff --git a/src/__tests__/react-native-test.js b/src/__tests__/react-native-test.js
index 3d7b4cc..802bc92 100644
--- a/src/__tests__/react-native-test.js
+++ b/src/__tests__/react-native-test.js
@@ -10,7 +10,7 @@ jest.dontMock('../ParseObject');
 jest.dontMock('../Storage');
 
 jest.mock(
-  '../../../../react-native/Libraries/vendor/emitter/EventEmitter',
+  '../../../../react-native/Libraries/vendor/emitter/_EventEmitter',
   () => {
     return {
       prototype: {
@@ -21,7 +21,7 @@ jest.mock(
   { virtual: true }
 );
 
-const mockEmitter = require('../../../../react-native/Libraries/vendor/emitter/EventEmitter');
+const mockEmitter = require('../../../../react-native/Libraries/vendor/emitter/_EventEmitter');
 const CoreManager = require('../CoreManager');
 
 describe('React Native', () => {