Skip to content

Commit d2d49d7

Browse files
committed
chore: new example
1 parent c2be8a2 commit d2d49d7

Some content is hidden

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

56 files changed

+9420
-12477
lines changed

example/.buckconfig

-6
This file was deleted.

example/.eslintrc.js

+1-13
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,4 @@
11
module.exports = {
22
root: true,
3-
extends: '@react-native-community',
4-
parser: '@typescript-eslint/parser',
5-
plugins: ['@typescript-eslint'],
6-
overrides: [
7-
{
8-
files: ['*.ts', '*.tsx'],
9-
rules: {
10-
'@typescript-eslint/no-shadow': ['error'],
11-
'no-shadow': 'off',
12-
'no-undef': 'off',
13-
},
14-
},
15-
],
3+
extends: '@react-native',
164
};

example/.gitignore

+18-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DerivedData
2020
*.hmap
2121
*.ipa
2222
*.xcuserstate
23-
ios/.xcode.env.local
23+
**/.xcode.env.local
2424

2525
# Android/IntelliJ
2626
#
@@ -31,19 +31,15 @@ local.properties
3131
*.iml
3232
*.hprof
3333
.cxx/
34+
*.keystore
35+
!debug.keystore
3436

3537
# node.js
3638
#
3739
node_modules/
3840
npm-debug.log
3941
yarn-error.log
4042

41-
# BUCK
42-
buck-out/
43-
\.buckd/
44-
*.keystore
45-
!debug.keystore
46-
4743
# fastlane
4844
#
4945
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
@@ -60,5 +56,19 @@ buck-out/
6056
*.jsbundle
6157

6258
# Ruby / CocoaPods
63-
/ios/Pods/
59+
**/Pods/
6460
/vendor/bundle/
61+
62+
# Temporary files created by Metro to check the health of the file watcher
63+
.metro-health-check*
64+
65+
# testing
66+
/coverage
67+
68+
# Yarn
69+
.yarn/*
70+
!.yarn/patches
71+
!.yarn/plugins
72+
!.yarn/releases
73+
!.yarn/sdks
74+
!.yarn/versions

example/.ruby-version

-1
This file was deleted.

example/.watchmanconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
{}
1+
{}

example/Gemfile

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
source 'https://rubygems.org'
22

33
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
4-
ruby '2.7.5'
4+
ruby ">= 2.6.10"
55

6-
gem 'cocoapods', '~> 1.11', '>= 1.11.3'
6+
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
7+
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
8+
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
9+
gem 'xcodeproj', '< 1.26.0'

example/Gemfile.lock

+25-19
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,27 @@ GEM
55
base64
66
nkf
77
rexml
8-
activesupport (7.1.3.2)
8+
activesupport (7.2.2.1)
99
base64
10+
benchmark (>= 0.3)
1011
bigdecimal
11-
concurrent-ruby (~> 1.0, >= 1.0.2)
12+
concurrent-ruby (~> 1.0, >= 1.3.1)
1213
connection_pool (>= 2.2.5)
1314
drb
1415
i18n (>= 1.6, < 2)
16+
logger (>= 1.4.2)
1517
minitest (>= 5.1)
16-
mutex_m
17-
tzinfo (~> 2.0)
18-
addressable (2.8.6)
19-
public_suffix (>= 2.0.2, < 6.0)
18+
securerandom (>= 0.3)
19+
tzinfo (~> 2.0, >= 2.0.5)
20+
addressable (2.8.7)
21+
public_suffix (>= 2.0.2, < 7.0)
2022
algoliasearch (1.27.5)
2123
httpclient (~> 2.8, >= 2.8.3)
2224
json (>= 1.5.1)
2325
atomos (0.1.3)
2426
base64 (0.2.0)
25-
bigdecimal (3.1.7)
27+
benchmark (0.4.0)
28+
bigdecimal (3.1.8)
2629
claide (1.1.0)
2730
cocoapods (1.15.2)
2831
addressable (~> 2.8)
@@ -62,50 +65,53 @@ GEM
6265
netrc (~> 0.11)
6366
cocoapods-try (1.2.0)
6467
colored2 (3.1.2)
65-
concurrent-ruby (1.2.3)
68+
concurrent-ruby (1.3.4)
6669
connection_pool (2.4.1)
6770
drb (2.2.1)
6871
escape (0.0.4)
6972
ethon (0.16.0)
7073
ffi (>= 1.15.0)
71-
ffi (1.16.3)
74+
ffi (1.17.0)
7275
fourflusher (2.3.1)
7376
fuzzy_match (2.0.4)
7477
gh_inspector (1.1.3)
7578
httpclient (2.8.3)
76-
i18n (1.14.4)
79+
i18n (1.14.6)
7780
concurrent-ruby (~> 1.0)
78-
json (2.7.2)
79-
minitest (5.22.3)
81+
json (2.9.1)
82+
logger (1.6.4)
83+
minitest (5.25.4)
8084
molinillo (0.8.0)
81-
mutex_m (0.2.0)
8285
nanaimo (0.3.0)
8386
nap (1.1.0)
8487
netrc (0.11.0)
8588
nkf (0.2.0)
8689
public_suffix (4.0.7)
87-
rexml (3.3.9)
90+
rexml (3.4.0)
8891
ruby-macho (2.5.1)
92+
securerandom (0.4.1)
8993
typhoeus (1.4.1)
9094
ethon (>= 0.9.0)
9195
tzinfo (2.0.6)
9296
concurrent-ruby (~> 1.0)
93-
xcodeproj (1.25.0)
97+
xcodeproj (1.25.1)
9498
CFPropertyList (>= 2.3.3, < 4.0)
9599
atomos (~> 0.1.3)
96100
claide (>= 1.0.2, < 2.0)
97101
colored2 (~> 3.1)
98102
nanaimo (~> 0.3.0)
99-
rexml (>= 3.3.2, < 4.0)
103+
rexml (>= 3.3.6, < 4.0)
100104

101105
PLATFORMS
102106
ruby
103107

104108
DEPENDENCIES
105-
cocoapods (~> 1.11, >= 1.11.3)
109+
activesupport (>= 6.1.7.5, != 7.1.0)
110+
cocoapods (>= 1.13, != 1.15.1, != 1.15.0)
111+
xcodeproj (< 1.26.0)
106112

107113
RUBY VERSION
108-
ruby 2.7.5p203
114+
ruby 3.1.4p223
109115

110116
BUNDLED WITH
111-
2.1.4
117+
2.3.26

example/README.md

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
This is a new [**React Native**](https://reactnative.dev) project, bootstrapped using [`@react-native-community/cli`](https://github.com/react-native-community/cli).
2+
3+
# Getting Started
4+
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:
12+
13+
```bash
14+
# using npm
15+
npm start
16+
17+
# OR using Yarn
18+
yarn start
19+
```
20+
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+
27+
```bash
28+
# using npm
29+
npm run android
30+
31+
# OR using Yarn
32+
yarn android
33+
```
34+
35+
### For iOS
36+
37+
```bash
38+
# using npm
39+
npm run ios
40+
41+
# OR using Yarn
42+
yarn ios
43+
```
44+
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:
74+
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.

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

+3
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 shipped 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

example/_node-version

-1
This file was deleted.

example/android/app/_BUCK

-55
This file was deleted.

0 commit comments

Comments
 (0)