compiled icon indicating copy to clipboard operation
compiled copied to clipboard

Fix bug where "import * as React from 'react'" is incompatible with @babel/plugin-transform-runtime

Open dddlr opened this issue 9 months ago • 3 comments

What is this change?

@compiled/babel-plugin automatically inserts a React import at the start of the file by default (as long as importReact is not turned off), in the form of import * as React from 'react'. This PR changes this import to import React from 'react'.

Why are we making this change?

Fix bug where "import * as React from 'react'" is incompatible with @babel/plugin-transform-runtime


PR checklist

Don't delete me!

I have...

  • [x] Updated or added applicable tests
  • [ ] Updated the documentation in website/
  • [ ] Added a changeset (if making any changes that affect Compiled's behaviour)

dddlr avatar Mar 13 '25 23:03 dddlr

⚠️ No Changeset found

Latest commit: c30b206ba82e8ee1db7de0a419885421fcea686e

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changeset-bot[bot] avatar Mar 13 '25 23:03 changeset-bot[bot]

Deploy Preview for compiled-css-in-js canceled.

Name Link
Latest commit c30b206ba82e8ee1db7de0a419885421fcea686e
Latest deploy log https://app.netlify.com/sites/compiled-css-in-js/deploys/67d3716435ca360008ef87a3

netlify[bot] avatar Mar 14 '25 00:03 netlify[bot]

Deploy Preview for compiled-css-in-js canceled.

Name Link
Latest commit c30b206ba82e8ee1db7de0a419885421fcea686e
Latest deploy log https://app.netlify.com/sites/compiled-css-in-js/deploys/67d3716435ca360008ef87a3

netlify[bot] avatar Mar 14 '25 00:03 netlify[bot]

closing stale PRs, feel free to copy this over to a new one if needed!

dddlr avatar Jul 11 '25 04:07 dddlr