Skip to content

Commit

Permalink
Add demo for updated react-native-threads on RN 0.70+
Browse files Browse the repository at this point in the history
  • Loading branch information
gaodeng committed Dec 20, 2023
1 parent dd4c085 commit 17a37ce
Show file tree
Hide file tree
Showing 5 changed files with 2,842 additions and 5,515 deletions.
12 changes: 11 additions & 1 deletion App.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View } from 'react-native';
import { StyleSheet, Text, View, Button } from 'react-native';
import { Thread } from 'react-native-threads';

// start a new react native JS process
const thread = new Thread('./thread.js');

export default function App() {
return (
<View style={styles.container}>
<Text>Open up App.js to start working on your app!</Text>
<Button title='hello' onPress={()=>{
// send a message, strings only
thread.postMessage('hello from app.js');
// listen for messages
thread.onmessage = (message) => console.log(message);
}}></Button>
<StatusBar style="auto" />
</View>
);
Expand Down
6 changes: 6 additions & 0 deletions ios/Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -447,6 +447,8 @@ PODS:
- React-jsi (= 0.72.6)
- React-logger (= 0.72.6)
- React-perflogger (= 0.72.6)
- RNThread (0.0.19):
- React
- SocketRocket (0.6.1)
- Yoga (1.14.0)

Expand Down Expand Up @@ -499,6 +501,7 @@ DEPENDENCIES:
- React-runtimescheduler (from `../node_modules/react-native/ReactCommon/react/renderer/runtimescheduler`)
- React-utils (from `../node_modules/react-native/ReactCommon/react/utils`)
- ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`)
- RNThread (from `../node_modules/react-native-threads`)
- Yoga (from `../node_modules/react-native/ReactCommon/yoga`)

SPEC REPOS:
Expand Down Expand Up @@ -601,6 +604,8 @@ EXTERNAL SOURCES:
:path: "../node_modules/react-native/ReactCommon/react/utils"
ReactCommon:
:path: "../node_modules/react-native/ReactCommon"
RNThread:
:path: "../node_modules/react-native-threads"
Yoga:
:path: "../node_modules/react-native/ReactCommon/yoga"

Expand Down Expand Up @@ -653,6 +658,7 @@ SPEC CHECKSUMS:
React-runtimescheduler: f23e337008403341177fc52ee4ca94e442c17ede
React-utils: fa59c9a3375fb6f4aeb66714fd3f7f76b43a9f16
ReactCommon: dd03c17275c200496f346af93a7b94c53f3093a4
RNThread: 17c816b7eaf58871630c851948ba549f6df1c7d6
SocketRocket: f32cd54efbe0f095c4d7594881e52619cfe80b17
Yoga: b76f1acfda8212aa16b7e26bcce3983230c82603

Expand Down
Loading

0 comments on commit 17a37ce

Please sign in to comment.