-
Notifications
You must be signed in to change notification settings - Fork 24.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: remove unavailable EventEmitter TS export #36109
Conversation
Base commit: 7535399 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, it looks like I accidentally exported added this as newly public with my change to split up the typings.
@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator. |
Actually not, it was that way before RN 71 as well 🙂 |
@NickGerleman merged this pull request in 7b14180. |
Summary: Discovered when bumping the RN documentation to typecheck against 0.72, facebook#36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Differential Revision: D44375081 fbshipit-source-id: 859078b71044e8a70a25062ced5c8429a63c23be
Summary: Pull Request resolved: facebook#36632 Discovered when bumping the RN documentation to typecheck against 0.72, facebook#36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Differential Revision: D44375081 fbshipit-source-id: 5b3f2343e8b3f224bfbc72b285f333afd45269bb
Summary: Pull Request resolved: facebook#36632 Discovered when bumping the RN documentation to typecheck against 0.72, facebook#36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Differential Revision: D44375081 fbshipit-source-id: a75e4be326deedbeb06370860344f3c96b9a5426
Summary: Pull Request resolved: facebook#36632 Discovered when bumping the RN documentation to typecheck against 0.72, facebook#36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Reviewed By: cortinico Differential Revision: D44375081 fbshipit-source-id: 74e1299749da9fb920742664a0ecccd871190947
Summary: Pull Request resolved: facebook#36632 Discovered when bumping the RN documentation to typecheck against 0.72, facebook#36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Reviewed By: cortinico Differential Revision: D44375081 fbshipit-source-id: 4f5e2b36a42c5917cea37a6f0cd0b53420cf6b27
Summary: Pull Request resolved: #36632 Discovered when bumping the RN documentation to typecheck against 0.72, #36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Reviewed By: cortinico Differential Revision: D44375081 fbshipit-source-id: c8dbd5694d3a728a0a2091210894d27c9d84a012
Summary: Pull Request resolved: #36632 Discovered when bumping the RN documentation to typecheck against 0.72, #36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Reviewed By: cortinico Differential Revision: D44375081 fbshipit-source-id: c8dbd5694d3a728a0a2091210894d27c9d84a012
Summary: Pull Request resolved: facebook#36632 Discovered when bumping the RN documentation to typecheck against 0.72, facebook#36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Reviewed By: cortinico Differential Revision: D44375081 fbshipit-source-id: c8dbd5694d3a728a0a2091210894d27c9d84a012
Summary: currently, using TS, this is a valid import: `import { EventEmitter } from 'react-native';` However, looking at the [index file](https://github.com/facebook/react-native/blob/main/index.js) we can see that there is no such export. I first thought I'd add the EventEmitter export in order to get the `index.js` in line with the types, but it appears that the Event Emitter will become a separate package at some point facebook#34401 so removing it from the types seems to be better for future. ## Changelog fix: remove unavailable EventEmitter TS export Pick one each for the category and type tags: [INTERNAL] [CHANGED] - remove unavailable EventEmitter TS export For more details, see: https://reactnative.dev/contributing/changelogs-in-pull-requests Pull Request resolved: facebook#36109 Test Plan: tested locally: using `import { EventEmitter } from 'react-native';` correctly gives `TS2305: Module '"react-native"' has no exported member 'EventEmitter'.` Reviewed By: javache, cortinico Differential Revision: D43155568 Pulled By: NickGerleman fbshipit-source-id: b9e8c3f4be9812637c8588d14a9ce4edf188ed36
Summary: Pull Request resolved: facebook#36632 Discovered when bumping the RN documentation to typecheck against 0.72, facebook#36109 removed the `EmitterSubscription` type which should be kept public. Changelog: [General][Fixed] - Export EmitterSubscription TypeScript Type Reviewed By: cortinico Differential Revision: D44375081 fbshipit-source-id: c8dbd5694d3a728a0a2091210894d27c9d84a012
Summary
currently, using TS, this is a valid import:
import { EventEmitter } from 'react-native';
However, looking at the index file we can see that there is no such export.
I first thought I'd add the EventEmitter export in order to get the
index.js
in line with the types, but it appears that the Event Emitter will become a separate package at some point #34401 so removing it from the types seems to be better for future.Changelog
fix: remove unavailable EventEmitter TS export
Pick one each for the category and type tags:
[INTERNAL] [CHANGED] - remove unavailable EventEmitter TS export
For more details, see:
https://reactnative.dev/contributing/changelogs-in-pull-requests
Test Plan
tested locally: using
import { EventEmitter } from 'react-native';
correctly givesTS2305: Module '"react-native"' has no exported member 'EventEmitter'.