Skip to content

Commit 1383a59

Browse files
retyuifacebook-github-bot
authored andcommitted
Replace JSX.Element with React.JSX.Element (#38615)
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
1 parent 823b795 commit 1383a59

File tree

1 file changed

+2
-2
lines changed
  • packages/react-native/template

1 file changed

+2
-2
lines changed

packages/react-native/template/App.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type SectionProps = PropsWithChildren<{
2929
title: string;
3030
}>;
3131

32-
function Section({children, title}: SectionProps): JSX.Element {
32+
function Section({children, title}: SectionProps): React.JSX.Element {
3333
const isDarkMode = useColorScheme() === 'dark';
3434
return (
3535
<View style={styles.sectionContainer}>
@@ -55,7 +55,7 @@ function Section({children, title}: SectionProps): JSX.Element {
5555
);
5656
}
5757

58-
function App(): JSX.Element {
58+
function App(): React.JSX.Element {
5959
const isDarkMode = useColorScheme() === 'dark';
6060

6161
const backgroundStyle = {

0 commit comments

Comments
 (0)