Skip to content

fix: use ES import for Platform instead of require - #58453

Open
retyui wants to merge 1 commit into
react:mainfrom
retyui:feat/retyui/no-require-for-platform
Open

fix: use ES import for Platform instead of require#58453
retyui wants to merge 1 commit into
react:mainfrom
retyui:feat/retyui/no-require-for-platform

Conversation

@retyui

@retyui retyui commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary:

Previously, the Metro inline plugin for Platform didn't work inside React Native files that used ES imports for Platform (making require() the only way for the inline plugin to do its job).

Read more: react/metro#1521 (comment)

Since the inline plugin was moved from metro to react-native-babel-preset (PR: #57848), this issue has been resolved, so using require() is no longer necessary.

Changelog:

[INTERNAL] [CHANGED] - Use ES module imports for Platform API

Test Plan:

...

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 10, 2026
@facebook-github-tools facebook-github-tools Bot added p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. p: Callstack Partner: Callstack Partner Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant