Skip to content

Commit 2bb142a

Browse files
Upgrade React Native Reanimated to 3.6
1 parent 19744ce commit 2bb142a

File tree

2,448 files changed

+421482
-7128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,448 files changed

+421482
-7128
lines changed

App.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

Screen.js renamed to App.tsx

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import Animated, {
44
useAnimatedStyle,
55
Easing,
66
} from 'react-native-reanimated';
7-
import {View, Button} from 'react-native';
7+
import {Button, StyleSheet, SafeAreaView} from 'react-native';
88
import React from 'react';
99

10-
export default function AnimatedStyleUpdateExample(props) {
10+
export default function App() {
1111
const randomWidth = useSharedValue(10);
1212

1313
const config = {
@@ -22,23 +22,27 @@ export default function AnimatedStyleUpdateExample(props) {
2222
});
2323

2424
return (
25-
<View
26-
style={{
27-
flex: 1,
28-
flexDirection: 'column',
29-
}}>
30-
<Animated.View
31-
style={[
32-
{width: 100, height: 80, backgroundColor: 'black', margin: 30},
33-
style,
34-
]}
35-
/>
25+
<SafeAreaView style={styles.container}>
26+
<Animated.View style={[styles.box, style]} />
3627
<Button
3728
title="toggle"
3829
onPress={() => {
3930
randomWidth.value = Math.random() * 350;
4031
}}
4132
/>
42-
</View>
33+
</SafeAreaView>
4334
);
4435
}
36+
37+
const styles = StyleSheet.create({
38+
container: {
39+
flex: 1,
40+
flexDirection: 'column',
41+
},
42+
box: {
43+
width: 100,
44+
height: 80,
45+
backgroundColor: 'black',
46+
margin: 30,
47+
},
48+
});

Gemfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source 'https://rubygems.org'
2+
3+
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4+
ruby ">= 2.6.10"
5+
6+
gem 'cocoapods', '~> 1.13'
7+
gem 'activesupport', '>= 6.1.7.3', '< 7.1.0'

Gemfile.lock

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
CFPropertyList (3.0.6)
5+
rexml
6+
activesupport (7.0.8)
7+
concurrent-ruby (~> 1.0, >= 1.0.2)
8+
i18n (>= 1.6, < 2)
9+
minitest (>= 5.1)
10+
tzinfo (~> 2.0)
11+
addressable (2.8.5)
12+
public_suffix (>= 2.0.2, < 6.0)
13+
algoliasearch (1.27.5)
14+
httpclient (~> 2.8, >= 2.8.3)
15+
json (>= 1.5.1)
16+
atomos (0.1.3)
17+
claide (1.1.0)
18+
cocoapods (1.14.3)
19+
addressable (~> 2.8)
20+
claide (>= 1.0.2, < 2.0)
21+
cocoapods-core (= 1.14.3)
22+
cocoapods-deintegrate (>= 1.0.3, < 2.0)
23+
cocoapods-downloader (>= 2.1, < 3.0)
24+
cocoapods-plugins (>= 1.0.0, < 2.0)
25+
cocoapods-search (>= 1.0.0, < 2.0)
26+
cocoapods-trunk (>= 1.6.0, < 2.0)
27+
cocoapods-try (>= 1.1.0, < 2.0)
28+
colored2 (~> 3.1)
29+
escape (~> 0.0.4)
30+
fourflusher (>= 2.3.0, < 3.0)
31+
gh_inspector (~> 1.0)
32+
molinillo (~> 0.8.0)
33+
nap (~> 1.0)
34+
ruby-macho (>= 2.3.0, < 3.0)
35+
xcodeproj (>= 1.23.0, < 2.0)
36+
cocoapods-core (1.14.3)
37+
activesupport (>= 5.0, < 8)
38+
addressable (~> 2.8)
39+
algoliasearch (~> 1.0)
40+
concurrent-ruby (~> 1.1)
41+
fuzzy_match (~> 2.0.4)
42+
nap (~> 1.0)
43+
netrc (~> 0.11)
44+
public_suffix (~> 4.0)
45+
typhoeus (~> 1.0)
46+
cocoapods-deintegrate (1.0.5)
47+
cocoapods-downloader (2.1)
48+
cocoapods-plugins (1.0.0)
49+
nap
50+
cocoapods-search (1.0.1)
51+
cocoapods-trunk (1.6.0)
52+
nap (>= 0.8, < 2.0)
53+
netrc (~> 0.11)
54+
cocoapods-try (1.2.0)
55+
colored2 (3.1.2)
56+
concurrent-ruby (1.2.2)
57+
escape (0.0.4)
58+
ethon (0.16.0)
59+
ffi (>= 1.15.0)
60+
ffi (1.16.3)
61+
fourflusher (2.3.1)
62+
fuzzy_match (2.0.4)
63+
gh_inspector (1.1.3)
64+
httpclient (2.8.3)
65+
i18n (1.14.1)
66+
concurrent-ruby (~> 1.0)
67+
json (2.6.3)
68+
minitest (5.20.0)
69+
molinillo (0.8.0)
70+
nanaimo (0.3.0)
71+
nap (1.1.0)
72+
netrc (0.11.0)
73+
public_suffix (4.0.7)
74+
rexml (3.2.6)
75+
ruby-macho (2.5.1)
76+
typhoeus (1.4.1)
77+
ethon (>= 0.9.0)
78+
tzinfo (2.0.6)
79+
concurrent-ruby (~> 1.0)
80+
xcodeproj (1.23.0)
81+
CFPropertyList (>= 2.3.3, < 4.0)
82+
atomos (~> 0.1.3)
83+
claide (>= 1.0.2, < 2.0)
84+
colored2 (~> 3.1)
85+
nanaimo (~> 0.3.0)
86+
rexml (~> 3.2.4)
87+
88+
PLATFORMS
89+
ruby
90+
91+
DEPENDENCIES
92+
activesupport (>= 6.1.7.3, < 7.1.0)
93+
cocoapods (~> 1.13)
94+
95+
RUBY VERSION
96+
ruby 2.7.6p219
97+
98+
BUNDLED WITH
99+
2.1.4

README.md

Lines changed: 66 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,79 @@
1-
# reanimated-2-playground
1+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
22

3-
This repo contains a fresh React Native project with preinstalled Reanimated V2
3+
# Getting Started
44

5-
Checkout using the following command to start playing with the new Reanimated API:
5+
>**Note**: Make sure you have completed the [React Native - Environment Setup](https://reactnative.dev/docs/environment-setup) instructions till "Creating a new application" step, before proceeding.
6+
7+
## Step 1: Start the Metro Server
8+
9+
First, you will need to start **Metro**, the JavaScript _bundler_ that ships _with_ React Native.
10+
11+
To start Metro, run the following command from the _root_ of your React Native project:
612

713
```bash
8-
git clone https://github.com/software-mansion-labs/reanimated-2-playground.git
14+
# using npm
15+
npm start
16+
17+
# OR using Yarn
18+
yarn start
919
```
1020

11-
Don't forget to install dependencies:
21+
## Step 2: Start your Application
22+
23+
Let Metro Bundler run in its _own_ terminal. Open a _new_ terminal from the _root_ of your React Native project. Run the following command to start your _Android_ or _iOS_ app:
24+
25+
### For Android
26+
1227
```bash
13-
cd reanimated-2-playground && yarn
28+
# using npm
29+
npm run android
30+
31+
# OR using Yarn
32+
yarn android
1433
```
1534

16-
If you want to install app on the iOS simulator:
35+
### For iOS
36+
1737
```bash
18-
npx pod-install
38+
# using npm
39+
npm run ios
40+
41+
# OR using Yarn
42+
yarn ios
1943
```
2044

21-
Then run the app using Xcode or `react-native` CLI.
45+
If everything is set up _correctly_, you should see your new app running in your _Android Emulator_ or _iOS Simulator_ shortly provided you have set up your emulator/simulator correctly.
46+
47+
This is one way to run your app — you can also run it directly from within Android Studio and Xcode respectively.
48+
49+
## Step 3: Modifying your App
50+
51+
Now that you have successfully run the app, let's modify it.
52+
53+
1. Open `App.tsx` in your text editor of choice and edit some lines.
54+
2. For **Android**: Press the <kbd>R</kbd> key twice or select **"Reload"** from the **Developer Menu** (<kbd>Ctrl</kbd> + <kbd>M</kbd> (on Window and Linux) or <kbd>Cmd ⌘</kbd> + <kbd>M</kbd> (on macOS)) to see your changes!
55+
56+
For **iOS**: Hit <kbd>Cmd ⌘</kbd> + <kbd>R</kbd> in your iOS Simulator to reload the app and see your changes!
57+
58+
## Congratulations! :tada:
59+
60+
You've successfully run and modified your React Native App. :partying_face:
61+
62+
### Now what?
63+
64+
- If you want to add this new React Native code to an existing application, check out the [Integration guide](https://reactnative.dev/docs/integration-with-existing-apps).
65+
- If you're curious to learn more about React Native, check out the [Introduction to React Native](https://reactnative.dev/docs/getting-started).
66+
67+
# Troubleshooting
68+
69+
If you can't get this to work, see the [Troubleshooting](https://reactnative.dev/docs/troubleshooting) page.
70+
71+
# Learn More
72+
73+
To learn more about React Native, take a look at the following resources:
2274

23-
[Check Reanimated 2 documentation here.](https://docs.swmansion.com/react-native-reanimated/)
75+
- [React Native Website](https://reactnative.dev) - learn more about React Native.
76+
- [Getting Started](https://reactnative.dev/docs/environment-setup) - an **overview** of React Native and how setup your environment.
77+
- [Learn the Basics](https://reactnative.dev/docs/getting-started) - a **guided tour** of the React Native **basics**.
78+
- [Blog](https://reactnative.dev/blog) - read the latest official React Native **Blog** posts.
79+
- [`@facebook/react-native`](https://github.com/facebook/react-native) - the Open Source; GitHub **repository** for React Native.

__tests__/App-test.js renamed to __tests__/App.test.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import 'react-native';
66
import React from 'react';
77
import App from '../App';
88

9+
// Note: import explicitly to use the types shiped with jest.
10+
import {it} from '@jest/globals';
11+
912
// Note: test renderer must be required after react-native.
1013
import renderer from 'react-test-renderer';
1114

android/.project

Lines changed: 0 additions & 17 deletions
This file was deleted.

android/.settings/org.eclipse.buildship.core.prefs

Lines changed: 0 additions & 2 deletions
This file was deleted.

android/app/.classpath

Lines changed: 0 additions & 6 deletions
This file was deleted.

android/app/.project

Lines changed: 0 additions & 23 deletions
This file was deleted.

android/app/.settings/org.eclipse.buildship.core.prefs

Lines changed: 0 additions & 2 deletions
This file was deleted.

android/app/BUCK

Lines changed: 0 additions & 55 deletions
This file was deleted.

0 commit comments

Comments
 (0)