Skip to content

Commit 3bb86b0

Browse files
coadofacebook-github-bot
authored andcommitted
Change Animated re-export to generate correct namespace in TS (#50222)
Summary: Pull Request resolved: #50222 The flow-api-translator will generate ```ts export * as default from './AnimatedExports'; ``` in TS which preserves the namespace. Previous import, export translated to: ```ts declare const $$EXPORT_DEFAULT_DECLARATION$$: typeof Animated; declare type $$EXPORT_DEFAULT_DECLARATION$$ = typeof $$EXPORT_DEFAULT_DECLARATION$$; export default $$EXPORT_DEFAULT_DECLARATION$$; ``` which dropped the `Animated` namespace. Changelog: [Internal] Reviewed By: huntie Differential Revision: D71737199 fbshipit-source-id: a46a7ddddd023fa831cd4bb50f17a0641f328066
1 parent 9c5cf4e commit 3bb86b0

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

packages/react-native/Libraries/Animated/Animated.js.flow

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,5 @@
99
* @oncall react_native
1010
*/
1111

12-
import * as Animated from './AnimatedExports';
13-
12+
export * as default from './AnimatedExports';
1413
export type {CompositeAnimation, Numeric} from './AnimatedImplementation';
15-
export default Animated;

packages/react-native/Libraries/__tests__/__snapshots__/public-api-test.js.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,8 @@ declare export default typeof Animated;
118118
`;
119119

120120
exports[`public API should not change unintentionally Libraries/Animated/Animated.js.flow 1`] = `
121-
"export type { CompositeAnimation, Numeric } from \\"./AnimatedImplementation\\";
122-
declare export default typeof Animated;
121+
"export * as default from \\"./AnimatedExports\\";
122+
export type { CompositeAnimation, Numeric } from \\"./AnimatedImplementation\\";
123123
"
124124
`;
125125

0 commit comments

Comments
 (0)