File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change 11import { useEffect , useState } from "react" ;
22import { Platform } from "react-native" ;
33
4- // eslint-disable-next-line @typescript-eslint/no-namespace
5- declare namespace global {
6- var _IS_FABRIC : boolean ;
7- }
8-
4+ const { OS } = Platform ;
95const ANDROID_WS_HOST = "10.0.2.2" ;
106const IOS_WS_HOST = "localhost" ;
11- const HOST = Platform . OS === "android" ? ANDROID_WS_HOST : IOS_WS_HOST ;
7+ const HOST = OS === "android" ? ANDROID_WS_HOST : IOS_WS_HOST ;
128const PORT = 4242 ;
9+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
10+ const arch = ( global as any ) ?. nativeFabricUIManager ? "fabric" : "paper" ;
1311
1412type UseClient = [ client : WebSocket | null , hostname : string ] ;
1513export const useClient = ( ) : UseClient => {
@@ -24,8 +22,8 @@ export const useClient = (): UseClient => {
2422 setClient ( ws ) ;
2523 ws . send (
2624 JSON . stringify ( {
27- OS : Platform . OS ,
28- arch : "paper" ,
25+ OS ,
26+ arch,
2927 } )
3028 ) ;
3129 } ;
You can’t perform that action at this time.
0 commit comments