Skip to content

Commit 9848bb3

Browse files
committed
[LOCAL] Enable Network panel on Android and iOS
1 parent 6ab7738 commit 9848bb3

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

packages/react-native/ReactCommon/react/networking/CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,10 @@ target_link_libraries(react_networking
2121
jsinspector_tracing
2222
react_performance_timeline
2323
react_timing)
24+
25+
if(${CMAKE_BUILD_TYPE} MATCHES Debug OR REACT_NATIVE_DEBUG_OPTIMIZED)
26+
target_compile_options(react_networking PRIVATE
27+
-DREACT_NATIVE_DEBUGGER_ENABLED=1
28+
-DREACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1
29+
)
30+
endif ()

packages/react-native/scripts/cocoapods/utils.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ def self.set_gcc_preprocessor_definition_for_React_hermes(installer)
5959
def self.set_gcc_preprocessor_definition_for_debugger(installer)
6060
self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED=1", "React-jsinspector", :debug)
6161
self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED=1", "React-RCTNetwork", :debug)
62+
self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED=1", "React-networking", :debug)
6263
self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1", "React-jsinspector", :debug)
6364
self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1", "React-RCTNetwork", :debug)
65+
self.add_build_settings_to_pod(installer, "GCC_PREPROCESSOR_DEFINITIONS", "REACT_NATIVE_DEBUGGER_ENABLED_DEVONLY=1", "React-networking", :debug)
6466
end
6567

6668
def self.turn_off_resource_bundle_react_core(installer)

packages/rn-tester/Podfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2867,7 +2867,7 @@ SPEC CHECKSUMS:
28672867
FBLazyVector: de0a13d4ad13d3c8b9b8dc87029ba853a7d40258
28682868
fmt: a40bb5bd0294ea969aaaba240a927bd33d878cdd
28692869
glog: 5683914934d5b6e4240e497e0f4a3b42d1854183
2870-
hermes-engine: 16be4c407a55e0e37b6d8fe832200a4c73957acf
2870+
hermes-engine: ceec0a655a0bf68fbe572add8a8400ad5bd597ab
28712871
MyNativeView: 1af823608512b912ff60718a6d48bacbece9c1f0
28722872
NativeCxxModuleExample: ed1893117fdd164b44e67b2a1d7f4620610a8081
28732873
OCMock: 589f2c84dacb1f5aaf6e4cec1f292551fe748e74

packages/rn-tester/js/examples/Playground/RNTesterPlayground.js

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

1313
import RNTesterText from '../../components/RNTesterText';
1414
import * as React from 'react';
15-
import {StyleSheet, View} from 'react-native';
15+
import {Button, StyleSheet, View} from 'react-native';
1616

1717
function Playground() {
18+
function performNetworkRequest() {
19+
fetch('https://github.com/facebook/react-native')
20+
.then(response => console.log("Hello"))
21+
22+
}
23+
1824
return (
1925
<View style={styles.container}>
20-
<RNTesterText>
21-
Edit "RNTesterPlayground.js" to change this file
22-
</RNTesterText>
26+
<Button title="Perform Network Request" onPress={performNetworkRequest} />
2327
</View>
2428
);
2529
}

0 commit comments

Comments
 (0)