File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,6 @@ import {
1414// @ts -expect-error no type definitions available
1515import { version as coreVersion } from "react-native/Libraries/Core/ReactNativeVersion" ;
1616import { Colors , Header } from "react-native/Libraries/NewAppScreen" ;
17- // @ts -expect-error no type definitions available
18- import { isAsyncDebugging } from "react-native/Libraries/Utilities/DebugEnvironment" ;
1917
2018declare global {
2119 export const RN$Bridgeless : boolean ;
@@ -186,20 +184,31 @@ function Separator(): React.ReactElement {
186184 return < View style = { styles . separator } /> ;
187185}
188186
187+ // TODO: Remove this component when we drop support for <0.79
189188function DevMenu ( ) : React . ReactElement | null {
190189 const styles = useStyles ( ) ;
191190
192191 if ( ! isRemoteDebuggingAvailable ( ) ) {
193192 return null ;
194193 }
195194
196- return (
197- < View style = { styles . group } >
198- < Feature value = { isAsyncDebugging } onValueChange = { setRemoteDebugging } >
199- Remote Debugging
200- </ Feature >
201- </ View >
202- ) ;
195+ // Remote debugging was removed in 0.79:
196+ // https://github.com/facebook/react-native/commit/9aae84a688b5af87faf4b68676b6357de26f797f
197+ try {
198+ const {
199+ isAsyncDebugging,
200+ } = require ( "react-native/Libraries/Utilities/DebugEnvironment" ) ;
201+
202+ return (
203+ < View style = { styles . group } >
204+ < Feature value = { isAsyncDebugging } onValueChange = { setRemoteDebugging } >
205+ Remote Debugging
206+ </ Feature >
207+ </ View >
208+ ) ;
209+ } catch ( _ ) {
210+ return null ;
211+ }
203212}
204213
205214export function App ( props : AppProps ) : React . ReactElement < AppProps > {
You can’t perform that action at this time.
0 commit comments