1111import type { RNTesterModuleExample } from '../../types/RNTesterTypes' ;
1212
1313import * 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' ;
1616import { createPortal } from 'react-native/Libraries/ReactNative/RendererProxy' ;
1717
1818function PortalBasicExample ( ) : React . Node {
@@ -69,6 +69,11 @@ function PortalBasicExample(): React.Node {
6969
7070const 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+
7277function 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