Skip to content

Commit

Permalink
update react compiler example
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Aug 12, 2024
1 parent 9275405 commit 205e823
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 10 deletions.
11 changes: 7 additions & 4 deletions with-react-compiler/App.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useState } from "react";
import { Text } from "react-native";
import { Button, SafeAreaView, Text } from "react-native";

function Expensive() {
return <Text>Rendered: {new Date().toLocaleTimeString()}</Text>;
Expand All @@ -9,9 +9,12 @@ export default function Page() {
const [index, setIndex] = useState(0);

return (
<>
<Text onPress={() => setIndex((i) => i + 1)}>Increment {index}</Text>
<SafeAreaView>
<Button
onPress={() => setIndex((i) => i + 1)}
title={`Increment ${index}`}
/>
<Expensive />
</>
</SafeAreaView>
);
}
6 changes: 2 additions & 4 deletions with-react-compiler/app.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
{
"expo": {
"experiments": {
"reactCompiler": true
}
"experiments": {
"reactCompiler": true
}
}
4 changes: 2 additions & 2 deletions with-react-compiler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"lint": "expo lint"
},
"dependencies": {
"babel-plugin-react-compiler": "^0.0.0-experimental-938cd9a-20240601",
"expo": "^51.0.0",
"react": "18.2.0",
"react-native": "0.74.2"
Expand All @@ -17,7 +16,8 @@
"@types/react": "~18.2.79",
"eslint": "^8.57.0",
"eslint-config-expo": "^7.0.0",
"eslint-plugin-react-compiler": "^0.0.0-experimental-51a85ea-20240601",
"eslint-plugin-react-compiler": "0.0.0-experimental-9ed098e-20240725",
"babel-plugin-react-compiler": "0.0.0-experimental-334f00b-20240725",
"typescript": "~5.3.3"
}
}

0 comments on commit 205e823

Please sign in to comment.