Skip to content
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

Update usage.md - React import deprecated in transformer #37045

Closed
wants to merge 1 commit into from

Conversation

rob2d
Copy link

@rob2d rob2d commented Apr 26, 2023

Very minor update but: the need to import React has been deprecated since v17. Includes backporting to earlier versions as it happens in the standard JSX transform for a few years now e.g. internally transform if detecting JSX will create the following

// Inserted by a compiler (don't import it yourself!)
import {jsx as _jsx} from 'react/jsx-runtime';

function App() {
  return _jsx('h1', { children: 'Hello world' });
}

Considering this, it shouldn't be a backwards compatibility concern (especially on v5 doc).

Source: https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports

  • I have followed (at least) the PR section of the contributing guide.
    Note that it was suggested to fork locally if creating a "large change"/unquote, so hopefully this being a very minor doc update is fine to directly PR quickly.

Very minor update but: the need to import `React` has been deprecated since v17. Includes backporting to earlier versions as it happens in the standard JSX transform for a few years now e.g. internally transform if detecting JSX will create the following

```
// Inserted by a compiler (don't import it yourself!)
import {jsx as _jsx} from 'react/jsx-runtime';

function App() {
  return _jsx('h1', { children: 'Hello world' });
}
```

Source: https://legacy.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html#removing-unused-react-imports

Signed-off-by: rob2d <robert.concepcion.iii@gmail.com>
@rob2d rob2d changed the title Update usage.md Update usage.md - React import deprecated in transformer Apr 26, 2023
@rob2d rob2d changed the title Update usage.md - React import deprecated in transformer Update usage.md - React import deprecated in transformer Apr 26, 2023
@mui-bot
Copy link

mui-bot commented Apr 26, 2023

Netlify deploy preview

Bundle size report

No bundle size changes

Generated by 🚫 dangerJS against 3707fe3

@rob2d rob2d marked this pull request as draft April 27, 2023 03:00
@oliviertassinari oliviertassinari added the docs Improvements or additions to the documentation label May 18, 2023
@oliviertassinari
Copy link
Member

oliviertassinari commented May 18, 2023

So, kind of the same as #33811

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label Aug 9, 2023
@ZeeshanTamboli
Copy link
Member

I am closing this. See #33811 (comment). This is also tracked for v6 - #30660.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Improvements or additions to the documentation PR: out-of-date The pull request has merge conflicts and can't be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants