Skip to content

Commit

Permalink
Replace JSX.Element with React.JSX.Element (#38615)
Browse files Browse the repository at this point in the history
Summary:
the global `JSX` namespace was depreacted in react 18:

```tsx
declare global {
    /**
     * deprecated Use `React.JSX` instead of the global `JSX` namespace.
     */
    namespace JSX {
```

## Changelog:

[GENERAL] [CHANGED] - Replace `JSX.Element` with `React.JSX.Element` in `App.tsx` template

Pull Request resolved: #38615

Test Plan:
Before

<img width="686" alt="Screenshot 2023-07-25 at 14 11 59" src="https://github.com/facebook/react-native/assets/4661784/531a4f88-8090-43aa-86d6-4af595d4cb5d">

After

<img width="445" alt="Screenshot 2023-07-25 at 14 12 12" src="https://github.com/facebook/react-native/assets/4661784/3b427938-2768-4131-b77a-62045e5b8d08">

Reviewed By: rshest

Differential Revision: D47873435

Pulled By: NickGerleman

fbshipit-source-id: c8a9e0e8e96a54c6ee66fcae2392e0d20d20d026
  • Loading branch information
retyui authored and facebook-github-bot committed Jul 29, 2023
1 parent 823b795 commit 1383a59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-native/template/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type SectionProps = PropsWithChildren<{
title: string;
}>;

function Section({children, title}: SectionProps): JSX.Element {
function Section({children, title}: SectionProps): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';
return (
<View style={styles.sectionContainer}>
Expand All @@ -55,7 +55,7 @@ function Section({children, title}: SectionProps): JSX.Element {
);
}

function App(): JSX.Element {
function App(): React.JSX.Element {
const isDarkMode = useColorScheme() === 'dark';

const backgroundStyle = {
Expand Down

0 comments on commit 1383a59

Please sign in to comment.