Skip to content

Commit af05cf2

Browse files
fix build type
1 parent baf5257 commit af05cf2

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

packages/rn-tester/js/examples/Portal/PortalExample.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import type {RNTesterModuleExample} from '../../types/RNTesterTypes';
1212

1313
import * as React from 'react';
14-
import {useState, useCallback} from 'react';
15-
import {View, Text, StyleSheet, Button, findNodeHandle} from 'react-native';
14+
import {useCallback, useState} from 'react';
15+
import {Button, StyleSheet, Text, View, findNodeHandle} from 'react-native';
1616
import {createPortal} from 'react-native/Libraries/ReactNative/RendererProxy';
1717

1818
function PortalBasicExample(): React.Node {
@@ -69,6 +69,11 @@ function PortalBasicExample(): React.Node {
6969

7070
const ThemeContext = React.createContext<string>('light');
7171

72+
function ContextReader(): React.Node {
73+
const theme = React.useContext(ThemeContext);
74+
return <Text style={styles.portalText}>Theme: {theme}</Text>;
75+
}
76+
7277
function PortalContextExample(): React.Node {
7378
const [showPortal, setShowPortal] = useState(false);
7479
const [targetTag, setTargetTag] = useState<number | null>(null);
@@ -87,11 +92,6 @@ function PortalContextExample(): React.Node {
8792
}
8893
}, [showPortal]);
8994

90-
const ContextReader = () => {
91-
const theme = React.useContext(ThemeContext);
92-
return <Text style={styles.portalText}>Theme: {theme}</Text>;
93-
};
94-
9595
return (
9696
<ThemeContext.Provider value="dark">
9797
<View style={styles.container}>

0 commit comments

Comments
 (0)