├── .eslintignore ├── .eslintrc ├── .github └── workflows │ └── publish.yml ├── .gitignore ├── .husky ├── commit-msg ├── pre-commit └── pre-push ├── .npmignore ├── .prettierrc.js ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── assets ├── demo.gif ├── doubleTap.gif ├── pinchZoom.gif ├── reactNativeImagePreview.gif ├── simple.gif └── swipeDownClose.gif ├── babel.config.js ├── example ├── .buckconfig ├── .bundle │ └── config ├── .gitignore ├── .node-version ├── .prettierrc.js ├── .ruby-version ├── .watchmanconfig ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── rn_example │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── rn_example │ │ │ │ ├── MainActivity.java │ │ │ │ ├── MainApplication.java │ │ │ │ └── newarchitecture │ │ │ │ ├── MainApplicationReactNativeHost.java │ │ │ │ ├── components │ │ │ │ └── MainComponentsRegistry.java │ │ │ │ └── modules │ │ │ │ └── MainApplicationTurboModuleManagerDelegate.java │ │ │ ├── jni │ │ │ ├── CMakeLists.txt │ │ │ ├── MainApplicationModuleProvider.cpp │ │ │ ├── MainApplicationModuleProvider.h │ │ │ ├── MainApplicationTurboModuleManagerDelegate.cpp │ │ │ ├── MainApplicationTurboModuleManagerDelegate.h │ │ │ ├── MainComponentsRegistry.cpp │ │ │ ├── MainComponentsRegistry.h │ │ │ └── OnLoad.cpp │ │ │ └── res │ │ │ ├── drawable │ │ │ └── rn_edit_text_material.xml │ │ │ ├── mipmap-hdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ ├── ic_launcher.png │ │ │ └── ic_launcher_round.png │ │ │ └── values │ │ │ ├── strings.xml │ │ │ └── styles.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradlew │ ├── gradlew.bat │ └── settings.gradle ├── app.json ├── babel.config.js ├── index.js ├── ios │ ├── .xcode.env │ ├── Podfile │ ├── Podfile.lock │ ├── rn_example.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── rn_example.xcscheme │ ├── rn_example.xcworkspace │ │ └── contents.xcworkspacedata │ ├── rn_example │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ └── rn_exampleTests │ │ ├── Info.plist │ │ └── rn_exampleTests.m ├── metro.config.js ├── package.json ├── src │ ├── App.tsx │ ├── assets │ │ ├── images │ │ │ ├── close.png │ │ │ ├── forest.jpeg │ │ │ └── index.ts │ │ └── index.ts │ ├── components │ │ ├── CustomHeader.tsx │ │ ├── ModalHeader.tsx │ │ ├── Types.ts │ │ ├── index.ts │ │ └── styles │ │ │ ├── CustomHeaderStyle.ts │ │ │ ├── ModalHeaderStyle.ts │ │ │ └── index.ts │ ├── constants │ │ ├── StaticData.ts │ │ ├── Strings.ts │ │ └── index.ts │ └── theme │ │ ├── ApplicationStyle.ts │ │ ├── Colors.ts │ │ ├── Metrics.ts │ │ └── index.ts └── tsconfig.json ├── package.json ├── src ├── assets │ ├── images │ │ ├── errorImage.png │ │ └── index.ts │ └── index.ts ├── components │ ├── ImagePreview │ │ ├── ImagePreview.tsx │ │ ├── Styles.ts │ │ ├── Types.ts │ │ ├── components │ │ │ ├── ErrorImage.tsx │ │ │ ├── Header.tsx │ │ │ ├── ImageLoader.tsx │ │ │ ├── ImageModal.tsx │ │ │ ├── index.ts │ │ │ └── styles │ │ │ │ ├── ErrorImageStyle.ts │ │ │ │ ├── HeaderStyle.ts │ │ │ │ ├── ImageLoaderStyle.ts │ │ │ │ ├── ImageModalStyle.ts │ │ │ │ └── index.ts │ │ ├── hooks │ │ │ ├── index.ts │ │ │ ├── useImageModal.ts │ │ │ └── useImagePreview.ts │ │ └── index.ts │ └── index.ts ├── constants │ ├── StaticValues.ts │ ├── Strings.ts │ └── index.ts ├── index.ts └── theme │ ├── Colors.ts │ ├── Metrics.ts │ └── index.ts └── tsconfig.json /.eslintignore: -------------------------------------------------------------------------------- 1 | **/node_modules 2 | example/ 3 | lib/ 4 | -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "extends": ["@react-native-community", "prettier"], 3 | "root": true, 4 | "rules": { 5 | "prettier/prettier": [ 6 | "error", 7 | { 8 | "quoteProps": "preserve", 9 | "singleQuote": true, 10 | "tabWidth": 2, 11 | "trailingComma": "es5", 12 | "useTabs": false 13 | } 14 | ], 15 | "no-shadow": "off", 16 | "@typescript-eslint/no-shadow": ["error"], 17 | "no-bitwise": 0, 18 | "prefer-const": "warn", 19 | "no-console": ["error", { "allow": ["warn", "error"] }] 20 | }, 21 | "globals": { 22 | "JSX": "readonly" 23 | }, 24 | "env": { 25 | "jest": true 26 | }, 27 | "plugins": ["prettier"] 28 | } 29 | -------------------------------------------------------------------------------- /.github/workflows/publish.yml: -------------------------------------------------------------------------------- 1 | name: '🚀 Publish' 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | 8 | jobs: 9 | release: 10 | name: 🚀 Publish 11 | runs-on: macos-11 12 | steps: 13 | - name: 📚 checkout 14 | uses: actions/checkout@v2.4.2 15 | - name: 🟢 node 16 | uses: actions/setup-node@v3.3.0 17 | with: 18 | node-version: 16 19 | registry-url: https://registry.npmjs.org 20 | - name: 🚀 Build & Publish 21 | run: yarn install && yarn build && yarn publish --access public 22 | env: 23 | NODE_AUTH_TOKEN: ${{secrets.NPM_AUTH_TOKEN}} 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | 24 | # Android/IntelliJ 25 | # 26 | build/ 27 | .idea 28 | .gradle 29 | local.properties 30 | *.iml 31 | 32 | # node.js 33 | # 34 | node_modules/ 35 | npm-debug.log 36 | yarn-error.log* 37 | yarn.lock 38 | 39 | # BUCK 40 | buck-out/ 41 | \.buckd/ 42 | *.keystore 43 | !debug.keystore 44 | 45 | # fastlane 46 | # 47 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 48 | # screenshots whenever they are needed. 49 | # For more information about the recommended setup visit: 50 | # https://docs.fastlane.tools/best-practices/source-control/ 51 | 52 | */fastlane/report.xml 53 | */fastlane/Preview.html 54 | */fastlane/screenshots 55 | 56 | # Bundle artifact 57 | *.jsbundle 58 | 59 | # Ruby / CocoaPods 60 | /ios/Pods/ 61 | /vendor/bundle/ 62 | 63 | # generated 64 | lib 65 | -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn commitlint --edit $1 5 | -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn lint-staged 5 | -------------------------------------------------------------------------------- /.husky/pre-push: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | . "$(dirname "$0")/_/husky.sh" 3 | 4 | yarn build -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | .github/ 2 | .husky/ 3 | example/ 4 | assets/ 5 | .eslintignore 6 | .eslintrc 7 | CONTRIBUTING.md 8 | babel.config.js 9 | .buckconfig 10 | jest-setup.js 11 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: true, 5 | singleQuote: true, 6 | trailingComma: 'es5' 7 | }; 8 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | We welcome code changes that improve this library or fix a problem, and please make sure to follow all best practices and test all the changes/fixes before committing and creating a pull request. 🚀 🚀 4 | 5 | ### Committing and Pushing Changes 6 | 7 | Commit messages should be formatted as: 8 | 9 | ``` 10 | [optional scope]: 11 | 12 | [optional body] 13 | 14 | [optional footer] 15 | ``` 16 | 17 | Where type can be one of the following: 18 | 19 | - feat 20 | - fix 21 | - docs 22 | - chore 23 | - style 24 | - refactor 25 | - test 26 | 27 | and an optional scope can be a component 28 | 29 | ``` 30 | docs: update contributing guide 31 | ``` 32 | 33 | ``` 34 | fix(TicketId/Component): layout flicker issue 35 | ``` 36 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Simform Solutions 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![ImagesPreview - Simform](./assets/reactNativeImagePreview.gif) 2 | 3 | # react-native-images-preview 4 | 5 | ## [![npm version](https://img.shields.io/badge/npm%20package-0.0.1-orange)](https://www.npmjs.org/package/react-native-images-preview) [![Android](https://img.shields.io/badge/Platform-Android-green?logo=android)](https://www.android.com) [![iOS](https://img.shields.io/badge/Platform-iOS-green?logo=apple)](https://developer.apple.com/ios) [![MIT](https://img.shields.io/badge/License-MIT-green)](https://opensource.org/licenses/MIT) 6 | 7 | Introducing an image preview built with pure JavaScript and leveraging React Native Reanimated and GesturesHandler, enabling full-screen image previewing and zooming via double-tap and pinch gestures for effortless integration into applications. 8 | 9 | Our library is designed to be highly customizable, allowing developers to tailor it to their specific needs, such as changing the colors, styles, and other visual elements. Whether you're an Android or iOS user, our library is compatible with both platform, guaranteeing optimal performance. 10 | 11 | ## 🎬 Preview 12 | 13 | | Simple | SwipeDown Close | 14 | | :---------------------------------: | :-----------------------------------------: | 15 | | ![alt Default](./assets/simple.gif) | ![alt Default](./assets/swipeDownClose.gif) | 16 | 17 | | DoubleTap Zoom | Pinch Zoom | 18 | | :------------------------------------: | :------------------------------------: | 19 | | ![alt Default](./assets/doubleTap.gif) | ![alt Default](./assets/pinchZoom.gif) | 20 | 21 | ## Quick Access 22 | 23 | - [Installation](#installation) 24 | - [Usage and Examples](#usage) 25 | - [Properties](#properties) 26 | - [Example Code](#example) 27 | - [License](#license) 28 | 29 | ## Getting Started 🔧 30 | 31 | Here's how to get started with react-native-images-preview in your React Native project: 32 | 33 | ### Installation 34 | 35 | #### 1. Install the package 36 | 37 | Using `npm`: 38 | 39 | ```sh 40 | npm install react-native-images-preview react-native-reanimated react-native-gesture-handler 41 | ``` 42 | 43 | Using `yarn`: 44 | 45 | ```sh 46 | yarn add react-native-images-preview react-native-reanimated react-native-gesture-handler 47 | ``` 48 | 49 | ##### 2. Install cocoapods in the ios project 50 | 51 | ```sh 52 | cd ios && pod install 53 | ``` 54 | 55 | > Note: Make sure to add Reanimated's babel plugin to your`babel.config.js` 56 | 57 | ```sh 58 | module.exports = { 59 | ... 60 | plugins: [ 61 | ... 62 | 'react-native-reanimated/plugin', 63 | ], 64 | }; 65 | ``` 66 | 67 | > Note: For React Native 0.61 or greater, add react-native-gesture-handler in index.js file. 68 | 69 | ```sh 70 | import 'react-native-gesture-handler'; 71 | ``` 72 | 73 | ##### Know more about [react-native-reanimated](https://www.npmjs.com/package/react-native-reanimated) and [react-native-gesture-handler](https://www.npmjs.com/package/react-native-gesture-handler) 74 | 75 | ## Usage 76 | 77 | ```jsx 78 | import React from 'react'; 79 | import { StyleSheet, View } from 'react-native'; 80 | import { ImagePreview } from 'react-native-images-preview'; 81 | import { images } from './assets'; 82 | 83 | const App = () => { 84 | return ( 85 | 86 | 90 | 91 | ); 92 | }; 93 | 94 | export default App; 95 | 96 | const styles = StyleSheet.create({ 97 | screen: { 98 | flex: 1, 99 | justifyContent: 'center', 100 | alignItems: 'center', 101 | }, 102 | imageStyle: { 103 | height: 150, 104 | width: 250, 105 | }, 106 | }); 107 | ``` 108 | 109 | #### 🎬 Preview 110 | 111 | ![alt Default](./assets/demo.gif) 112 | 113 | ## Properties 114 | 115 | | Props | Default | Type | Description | 116 | | :-------------------- | :-----: | :---------------------: | :--------------------------------------------------------------------------------------------------- | 117 | | **imageSource** | - | ImageSourcePropType | Source of image | 118 | | **imageStyle** | - | `StyleProp` | Styling of image | 119 | | imageProps | - | ImageProps | Provide image props | 120 | | swipeDownCloseEnabled | true | boolean | Enable/Disable swipe down to close modal | 121 | | doubleTapZoomEnabled | true | boolean | Enable/Disable double tap to zoom | 122 | | pinchZoomEnabled | true | boolean | Enable/Disable pinch to zoom | 123 | | renderHeader | - | function | Call back function to render custom header and provide `close()` in argument | 124 | | renderImageLoader | - | function | Call back function to render custom image loader | 125 | | errorImageSource | - | ImageSourcePropType | Source of error image | 126 | | imageLoaderProps | - | ActivityIndicatorProps | Provide ActivityIndicator props | 127 | 128 | ##### Know more about [ImageProps](https://reactnative.dev/docs/image#props), [ActivityIndicatorProps](https://reactnative.dev/docs/activityindicator#props) 129 | 130 | ## Example 131 | 132 | A full working example project is here [Example](./example/src/App.tsx) 133 | 134 | ```sh 135 | yarn 136 | yarn example ios // For ios 137 | yarn example android // For Android 138 | ``` 139 | 140 | ## Find this library useful? ❤️ 141 | 142 | Support it by joining [stargazers](https://github.com/SimformSolutionsPvtLtd/react-native-images-preview/stargazers) for this repository.⭐ 143 | 144 | ## Bugs / Feature requests / Feedbacks 145 | 146 | For bugs, feature requests, and discussion please use [GitHub Issues](https://github.com/SimformSolutionsPvtLtd/react-native-images-preview/issues/new?labels=bug&late=BUG_REPORT.md&title=%5BBUG%5D%3A), [GitHub New Feature](https://github.com/SimformSolutionsPvtLtd/react-native-images-preview/issues/new?labels=enhancement&late=FEATURE_REQUEST.md&title=%5BFEATURE%5D%3A), [GitHub Feedback](https://github.com/SimformSolutionsPvtLtd/react-native-images-preview/issues/new?labels=enhancement&late=FEATURE_REQUEST.md&title=%5BFEEDBACK%5D%3A) 147 | 148 | ## 🤝 How to Contribute 149 | 150 | We'd love to have you improve this library or fix a problem 💪 151 | Check out our [Contributing Guide](CONTRIBUTING.md) for ideas on contributing. 152 | 153 | ## Awesome Mobile Libraries 154 | 155 | - Check out our other [available awesome mobile libraries](https://github.com/SimformSolutionsPvtLtd/Awesome-Mobile-Libraries) 156 | 157 | ## License 158 | 159 | - [MIT License](./LICENSE) 160 | -------------------------------------------------------------------------------- /assets/demo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/assets/demo.gif -------------------------------------------------------------------------------- /assets/doubleTap.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/assets/doubleTap.gif -------------------------------------------------------------------------------- /assets/pinchZoom.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/assets/pinchZoom.gif -------------------------------------------------------------------------------- /assets/reactNativeImagePreview.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/assets/reactNativeImagePreview.gif -------------------------------------------------------------------------------- /assets/simple.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/assets/simple.gif -------------------------------------------------------------------------------- /assets/swipeDownClose.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/assets/swipeDownClose.gif -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: ['react-native-reanimated/plugin'], 4 | }; 5 | -------------------------------------------------------------------------------- /example/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /example/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # OSX 2 | # 3 | .DS_Store 4 | 5 | # Xcode 6 | # 7 | build/ 8 | *.pbxuser 9 | !default.pbxuser 10 | *.mode1v3 11 | !default.mode1v3 12 | *.mode2v3 13 | !default.mode2v3 14 | *.perspectivev3 15 | !default.perspectivev3 16 | xcuserdata 17 | *.xccheckout 18 | *.moved-aside 19 | DerivedData 20 | *.hmap 21 | *.ipa 22 | *.xcuserstate 23 | ios/.xcode.env.local 24 | 25 | # Android/IntelliJ 26 | # 27 | build/ 28 | .idea 29 | .gradle 30 | local.properties 31 | *.iml 32 | *.hprof 33 | .cxx/ 34 | 35 | # node.js 36 | # 37 | node_modules/ 38 | npm-debug.log 39 | yarn-error.log 40 | yarn.lock 41 | 42 | # BUCK 43 | buck-out/ 44 | \.buckd/ 45 | *.keystore 46 | !debug.keystore 47 | 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://docs.fastlane.tools/best-practices/source-control/ 54 | 55 | **/fastlane/report.xml 56 | **/fastlane/Preview.html 57 | **/fastlane/screenshots 58 | **/fastlane/test_output 59 | 60 | # Bundle artifact 61 | *.jsbundle 62 | 63 | # Ruby / CocoaPods 64 | /ios/Pods/ 65 | /vendor/bundle/ 66 | -------------------------------------------------------------------------------- /example/.node-version: -------------------------------------------------------------------------------- 1 | 16 2 | -------------------------------------------------------------------------------- /example/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: true, 5 | singleQuote: true, 6 | trailingComma: 'es5', 7 | }; 8 | -------------------------------------------------------------------------------- /example/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /example/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /example/android/app/_BUCK: -------------------------------------------------------------------------------- 1 | # To learn about Buck see [Docs](https://buckbuild.com/). 2 | # To run your application with Buck: 3 | # - install Buck 4 | # - `npm start` - to start the packager 5 | # - `cd android` 6 | # - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"` 7 | # - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck 8 | # - `buck install -r android/app` - compile, install and run application 9 | # 10 | 11 | load(":build_defs.bzl", "create_aar_targets", "create_jar_targets") 12 | 13 | lib_deps = [] 14 | 15 | create_aar_targets(glob(["libs/*.aar"])) 16 | 17 | create_jar_targets(glob(["libs/*.jar"])) 18 | 19 | android_library( 20 | name = "all-libs", 21 | exported_deps = lib_deps, 22 | ) 23 | 24 | android_library( 25 | name = "app-code", 26 | srcs = glob([ 27 | "src/main/java/**/*.java", 28 | ]), 29 | deps = [ 30 | ":all-libs", 31 | ":build_config", 32 | ":res", 33 | ], 34 | ) 35 | 36 | android_build_config( 37 | name = "build_config", 38 | package = "com.rn_example", 39 | ) 40 | 41 | android_resource( 42 | name = "res", 43 | package = "com.rn_example", 44 | res = "src/main/res", 45 | ) 46 | 47 | android_binary( 48 | name = "app", 49 | keystore = "//android/keystores:debug", 50 | manifest = "src/main/AndroidManifest.xml", 51 | package_type = "debug", 52 | deps = [ 53 | ":app-code", 54 | ], 55 | ) 56 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "com.android.application" 2 | 3 | import com.android.build.OutputFile 4 | import org.apache.tools.ant.taskdefs.condition.Os 5 | 6 | /** 7 | * The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets 8 | * and bundleReleaseJsAndAssets). 9 | * These basically call `react-native bundle` with the correct arguments during the Android build 10 | * cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the 11 | * bundle directly from the development server. Below you can see all the possible configurations 12 | * and their defaults. If you decide to add a configuration block, make sure to add it before the 13 | * `apply from: "../../node_modules/react-native/react.gradle"` line. 14 | * 15 | * project.ext.react = [ 16 | * // the name of the generated asset file containing your JS bundle 17 | * bundleAssetName: "index.android.bundle", 18 | * 19 | * // the entry file for bundle generation. If none specified and 20 | * // "index.android.js" exists, it will be used. Otherwise "index.js" is 21 | * // default. Can be overridden with ENTRY_FILE environment variable. 22 | * entryFile: "index.android.js", 23 | * 24 | * // https://reactnative.dev/docs/performance#enable-the-ram-format 25 | * bundleCommand: "ram-bundle", 26 | * 27 | * // whether to bundle JS and assets in debug mode 28 | * bundleInDebug: false, 29 | * 30 | * // whether to bundle JS and assets in release mode 31 | * bundleInRelease: true, 32 | * 33 | * // whether to bundle JS and assets in another build variant (if configured). 34 | * // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants 35 | * // The configuration property can be in the following formats 36 | * // 'bundleIn${productFlavor}${buildType}' 37 | * // 'bundleIn${buildType}' 38 | * // bundleInFreeDebug: true, 39 | * // bundleInPaidRelease: true, 40 | * // bundleInBeta: true, 41 | * 42 | * // whether to disable dev mode in custom build variants (by default only disabled in release) 43 | * // for example: to disable dev mode in the staging build type (if configured) 44 | * devDisabledInStaging: true, 45 | * // The configuration property can be in the following formats 46 | * // 'devDisabledIn${productFlavor}${buildType}' 47 | * // 'devDisabledIn${buildType}' 48 | * 49 | * // the root of your project, i.e. where "package.json" lives 50 | * root: "../../", 51 | * 52 | * // where to put the JS bundle asset in debug mode 53 | * jsBundleDirDebug: "$buildDir/intermediates/assets/debug", 54 | * 55 | * // where to put the JS bundle asset in release mode 56 | * jsBundleDirRelease: "$buildDir/intermediates/assets/release", 57 | * 58 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 59 | * // require('./image.png')), in debug mode 60 | * resourcesDirDebug: "$buildDir/intermediates/res/merged/debug", 61 | * 62 | * // where to put drawable resources / React Native assets, e.g. the ones you use via 63 | * // require('./image.png')), in release mode 64 | * resourcesDirRelease: "$buildDir/intermediates/res/merged/release", 65 | * 66 | * // by default the gradle tasks are skipped if none of the JS files or assets change; this means 67 | * // that we don't look at files in android/ or ios/ to determine whether the tasks are up to 68 | * // date; if you have any other folders that you want to ignore for performance reasons (gradle 69 | * // indexes the entire tree), add them here. Alternatively, if you have JS files in android/ 70 | * // for example, you might want to remove it from here. 71 | * inputExcludes: ["android/**", "ios/**"], 72 | * 73 | * // override which node gets called and with what additional arguments 74 | * nodeExecutableAndArgs: ["node"], 75 | * 76 | * // supply additional arguments to the packager 77 | * extraPackagerArgs: [] 78 | * ] 79 | */ 80 | 81 | project.ext.react = [ 82 | enableHermes: false, // clean and rebuild if changing 83 | ] 84 | 85 | apply from: "../../node_modules/react-native/react.gradle" 86 | 87 | /** 88 | * Set this to true to create two separate APKs instead of one: 89 | * - An APK that only works on ARM devices 90 | * - An APK that only works on x86 devices 91 | * The advantage is the size of the APK is reduced by about 4MB. 92 | * Upload all the APKs to the Play Store and people will download 93 | * the correct one based on the CPU architecture of their device. 94 | */ 95 | def enableSeparateBuildPerCPUArchitecture = false 96 | 97 | /** 98 | * Run Proguard to shrink the Java bytecode in release builds. 99 | */ 100 | def enableProguardInReleaseBuilds = false 101 | 102 | /** 103 | * The preferred build flavor of JavaScriptCore. 104 | * 105 | * For example, to use the international variant, you can use: 106 | * `def jscFlavor = 'org.webkit:android-jsc-intl:+'` 107 | * 108 | * The international variant includes ICU i18n library and necessary data 109 | * allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that 110 | * give correct results when using with locales other than en-US. Note that 111 | * this variant is about 6MiB larger per architecture than default. 112 | */ 113 | def jscFlavor = 'org.webkit:android-jsc:+' 114 | 115 | /** 116 | * Whether to enable the Hermes VM. 117 | * 118 | * This should be set on project.ext.react and that value will be read here. If it is not set 119 | * on project.ext.react, JavaScript will not be compiled to Hermes Bytecode 120 | * and the benefits of using Hermes will therefore be sharply reduced. 121 | */ 122 | def enableHermes = project.ext.react.get("enableHermes", false); 123 | 124 | /** 125 | * Architectures to build native code for. 126 | */ 127 | def reactNativeArchitectures() { 128 | def value = project.getProperties().get("reactNativeArchitectures") 129 | return value ? value.split(",") : ["armeabi-v7a", "x86", "x86_64", "arm64-v8a"] 130 | } 131 | 132 | android { 133 | ndkVersion rootProject.ext.ndkVersion 134 | 135 | compileSdkVersion rootProject.ext.compileSdkVersion 136 | 137 | defaultConfig { 138 | applicationId "com.rn_example" 139 | minSdkVersion rootProject.ext.minSdkVersion 140 | targetSdkVersion rootProject.ext.targetSdkVersion 141 | versionCode 1 142 | versionName "1.0" 143 | buildConfigField "boolean", "IS_NEW_ARCHITECTURE_ENABLED", isNewArchitectureEnabled().toString() 144 | 145 | if (isNewArchitectureEnabled()) { 146 | // We configure the CMake build only if you decide to opt-in for the New Architecture. 147 | externalNativeBuild { 148 | cmake { 149 | arguments "-DPROJECT_BUILD_DIR=$buildDir", 150 | "-DREACT_ANDROID_DIR=$rootDir/../node_modules/react-native/ReactAndroid", 151 | "-DREACT_ANDROID_BUILD_DIR=$rootDir/../node_modules/react-native/ReactAndroid/build", 152 | "-DNODE_MODULES_DIR=$rootDir/../node_modules", 153 | "-DANDROID_STL=c++_shared" 154 | } 155 | } 156 | if (!enableSeparateBuildPerCPUArchitecture) { 157 | ndk { 158 | abiFilters (*reactNativeArchitectures()) 159 | } 160 | } 161 | } 162 | } 163 | 164 | if (isNewArchitectureEnabled()) { 165 | // We configure the NDK build only if you decide to opt-in for the New Architecture. 166 | externalNativeBuild { 167 | cmake { 168 | path "$projectDir/src/main/jni/CMakeLists.txt" 169 | } 170 | } 171 | def reactAndroidProjectDir = project(':ReactAndroid').projectDir 172 | def packageReactNdkDebugLibs = tasks.register("packageReactNdkDebugLibs", Copy) { 173 | dependsOn(":ReactAndroid:packageReactNdkDebugLibsForBuck") 174 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 175 | into("$buildDir/react-ndk/exported") 176 | } 177 | def packageReactNdkReleaseLibs = tasks.register("packageReactNdkReleaseLibs", Copy) { 178 | dependsOn(":ReactAndroid:packageReactNdkReleaseLibsForBuck") 179 | from("$reactAndroidProjectDir/src/main/jni/prebuilt/lib") 180 | into("$buildDir/react-ndk/exported") 181 | } 182 | afterEvaluate { 183 | // If you wish to add a custom TurboModule or component locally, 184 | // you should uncomment this line. 185 | // preBuild.dependsOn("generateCodegenArtifactsFromSchema") 186 | preDebugBuild.dependsOn(packageReactNdkDebugLibs) 187 | preReleaseBuild.dependsOn(packageReactNdkReleaseLibs) 188 | 189 | // Due to a bug inside AGP, we have to explicitly set a dependency 190 | // between configureCMakeDebug* tasks and the preBuild tasks. 191 | // This can be removed once this is solved: https://issuetracker.google.com/issues/207403732 192 | configureCMakeRelWithDebInfo.dependsOn(preReleaseBuild) 193 | configureCMakeDebug.dependsOn(preDebugBuild) 194 | reactNativeArchitectures().each { architecture -> 195 | tasks.findByName("configureCMakeDebug[${architecture}]")?.configure { 196 | dependsOn("preDebugBuild") 197 | } 198 | tasks.findByName("configureCMakeRelWithDebInfo[${architecture}]")?.configure { 199 | dependsOn("preReleaseBuild") 200 | } 201 | } 202 | } 203 | } 204 | 205 | splits { 206 | abi { 207 | reset() 208 | enable enableSeparateBuildPerCPUArchitecture 209 | universalApk false // If true, also generate a universal APK 210 | include (*reactNativeArchitectures()) 211 | } 212 | } 213 | signingConfigs { 214 | debug { 215 | storeFile file('debug.keystore') 216 | storePassword 'android' 217 | keyAlias 'androiddebugkey' 218 | keyPassword 'android' 219 | } 220 | } 221 | buildTypes { 222 | debug { 223 | signingConfig signingConfigs.debug 224 | } 225 | release { 226 | // Caution! In production, you need to generate your own keystore file. 227 | // see https://reactnative.dev/docs/signed-apk-android. 228 | signingConfig signingConfigs.debug 229 | minifyEnabled enableProguardInReleaseBuilds 230 | proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" 231 | } 232 | } 233 | 234 | // applicationVariants are e.g. debug, release 235 | applicationVariants.all { variant -> 236 | variant.outputs.each { output -> 237 | // For each separate APK per architecture, set a unique version code as described here: 238 | // https://developer.android.com/studio/build/configure-apk-splits.html 239 | // Example: versionCode 1 will generate 1001 for armeabi-v7a, 1002 for x86, etc. 240 | def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4] 241 | def abi = output.getFilter(OutputFile.ABI) 242 | if (abi != null) { // null for the universal-debug, universal-release variants 243 | output.versionCodeOverride = 244 | defaultConfig.versionCode * 1000 + versionCodes.get(abi) 245 | } 246 | 247 | } 248 | } 249 | } 250 | 251 | dependencies { 252 | implementation fileTree(dir: "libs", include: ["*.jar"]) 253 | 254 | //noinspection GradleDynamicVersion 255 | implementation "com.facebook.react:react-native:+" // From node_modules 256 | 257 | implementation "androidx.swiperefreshlayout:swiperefreshlayout:1.0.0" 258 | 259 | debugImplementation("com.facebook.flipper:flipper:${FLIPPER_VERSION}") { 260 | exclude group:'com.facebook.fbjni' 261 | } 262 | 263 | debugImplementation("com.facebook.flipper:flipper-network-plugin:${FLIPPER_VERSION}") { 264 | exclude group:'com.facebook.flipper' 265 | exclude group:'com.squareup.okhttp3', module:'okhttp' 266 | } 267 | 268 | debugImplementation("com.facebook.flipper:flipper-fresco-plugin:${FLIPPER_VERSION}") { 269 | exclude group:'com.facebook.flipper' 270 | } 271 | 272 | if (enableHermes) { 273 | //noinspection GradleDynamicVersion 274 | implementation("com.facebook.react:hermes-engine:+") { // From node_modules 275 | exclude group:'com.facebook.fbjni' 276 | } 277 | } else { 278 | implementation jscFlavor 279 | } 280 | } 281 | 282 | if (isNewArchitectureEnabled()) { 283 | // If new architecture is enabled, we let you build RN from source 284 | // Otherwise we fallback to a prebuilt .aar bundled in the NPM package. 285 | // This will be applied to all the imported transtitive dependency. 286 | configurations.all { 287 | resolutionStrategy.dependencySubstitution { 288 | substitute(module("com.facebook.react:react-native")) 289 | .using(project(":ReactAndroid")) 290 | .because("On New Architecture we're building React Native from source") 291 | substitute(module("com.facebook.react:hermes-engine")) 292 | .using(project(":ReactAndroid:hermes-engine")) 293 | .because("On New Architecture we're building Hermes from source") 294 | } 295 | } 296 | } 297 | 298 | // Run this once to be able to run the application with BUCK 299 | // puts all compile dependencies into folder libs for BUCK to use 300 | task copyDownloadableDepsToLibs(type: Copy) { 301 | from configurations.implementation 302 | into 'libs' 303 | } 304 | 305 | apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project) 306 | 307 | def isNewArchitectureEnabled() { 308 | // To opt-in for the New Architecture, you can either: 309 | // - Set `newArchEnabled` to true inside the `gradle.properties` file 310 | // - Invoke gradle with `-newArchEnabled=true` 311 | // - Set an environment variable `ORG_GRADLE_PROJECT_newArchEnabled=true` 312 | return project.hasProperty("newArchEnabled") && project.newArchEnabled == "true" 313 | } 314 | -------------------------------------------------------------------------------- /example/android/app/build_defs.bzl: -------------------------------------------------------------------------------- 1 | """Helper definitions to glob .aar and .jar targets""" 2 | 3 | def create_aar_targets(aarfiles): 4 | for aarfile in aarfiles: 5 | name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")] 6 | lib_deps.append(":" + name) 7 | android_prebuilt_aar( 8 | name = name, 9 | aar = aarfile, 10 | ) 11 | 12 | def create_jar_targets(jarfiles): 13 | for jarfile in jarfiles: 14 | name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")] 15 | lib_deps.append(":" + name) 16 | prebuilt_jar( 17 | name = name, 18 | binary_jar = jarfile, 19 | ) 20 | -------------------------------------------------------------------------------- /example/android/app/debug.keystore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/debug.keystore -------------------------------------------------------------------------------- /example/android/app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /example/android/app/src/debug/java/com/rn_example/ReactNativeFlipper.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. 3 | * 4 | *

This source code is licensed under the MIT license found in the LICENSE file in the root 5 | * directory of this source tree. 6 | */ 7 | package com.rn_example; 8 | 9 | import android.content.Context; 10 | import com.facebook.flipper.android.AndroidFlipperClient; 11 | import com.facebook.flipper.android.utils.FlipperUtils; 12 | import com.facebook.flipper.core.FlipperClient; 13 | import com.facebook.flipper.plugins.crashreporter.CrashReporterPlugin; 14 | import com.facebook.flipper.plugins.databases.DatabasesFlipperPlugin; 15 | import com.facebook.flipper.plugins.fresco.FrescoFlipperPlugin; 16 | import com.facebook.flipper.plugins.inspector.DescriptorMapping; 17 | import com.facebook.flipper.plugins.inspector.InspectorFlipperPlugin; 18 | import com.facebook.flipper.plugins.network.FlipperOkhttpInterceptor; 19 | import com.facebook.flipper.plugins.network.NetworkFlipperPlugin; 20 | import com.facebook.flipper.plugins.react.ReactFlipperPlugin; 21 | import com.facebook.flipper.plugins.sharedpreferences.SharedPreferencesFlipperPlugin; 22 | import com.facebook.react.ReactInstanceEventListener; 23 | import com.facebook.react.ReactInstanceManager; 24 | import com.facebook.react.bridge.ReactContext; 25 | import com.facebook.react.modules.network.NetworkingModule; 26 | import okhttp3.OkHttpClient; 27 | 28 | public class ReactNativeFlipper { 29 | public static void initializeFlipper(Context context, ReactInstanceManager reactInstanceManager) { 30 | if (FlipperUtils.shouldEnableFlipper(context)) { 31 | final FlipperClient client = AndroidFlipperClient.getInstance(context); 32 | 33 | client.addPlugin(new InspectorFlipperPlugin(context, DescriptorMapping.withDefaults())); 34 | client.addPlugin(new ReactFlipperPlugin()); 35 | client.addPlugin(new DatabasesFlipperPlugin(context)); 36 | client.addPlugin(new SharedPreferencesFlipperPlugin(context)); 37 | client.addPlugin(CrashReporterPlugin.getInstance()); 38 | 39 | NetworkFlipperPlugin networkFlipperPlugin = new NetworkFlipperPlugin(); 40 | NetworkingModule.setCustomClientBuilder( 41 | new NetworkingModule.CustomClientBuilder() { 42 | @Override 43 | public void apply(OkHttpClient.Builder builder) { 44 | builder.addNetworkInterceptor(new FlipperOkhttpInterceptor(networkFlipperPlugin)); 45 | } 46 | }); 47 | client.addPlugin(networkFlipperPlugin); 48 | client.start(); 49 | 50 | // Fresco Plugin needs to ensure that ImagePipelineFactory is initialized 51 | // Hence we run if after all native modules have been initialized 52 | ReactContext reactContext = reactInstanceManager.getCurrentReactContext(); 53 | if (reactContext == null) { 54 | reactInstanceManager.addReactInstanceEventListener( 55 | new ReactInstanceEventListener() { 56 | @Override 57 | public void onReactContextInitialized(ReactContext reactContext) { 58 | reactInstanceManager.removeReactInstanceEventListener(this); 59 | reactContext.runOnNativeModulesQueueThread( 60 | new Runnable() { 61 | @Override 62 | public void run() { 63 | client.addPlugin(new FrescoFlipperPlugin()); 64 | } 65 | }); 66 | } 67 | }); 68 | } else { 69 | client.addPlugin(new FrescoFlipperPlugin()); 70 | } 71 | } 72 | } 73 | } 74 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | 13 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rn_example/MainActivity.java: -------------------------------------------------------------------------------- 1 | package com.rn_example; 2 | 3 | import com.facebook.react.ReactActivity; 4 | import com.facebook.react.ReactActivityDelegate; 5 | import com.facebook.react.ReactRootView; 6 | 7 | public class MainActivity extends ReactActivity { 8 | 9 | /** 10 | * Returns the name of the main component registered from JavaScript. This is used to schedule 11 | * rendering of the component. 12 | */ 13 | @Override 14 | protected String getMainComponentName() { 15 | return "rn_example"; 16 | } 17 | 18 | /** 19 | * Returns the instance of the {@link ReactActivityDelegate}. There the Button is created and 20 | * you can specify the renderer you wish to use - the new renderer (Fabric) or the old renderer 21 | * (Paper). 22 | */ 23 | @Override 24 | protected ReactActivityDelegate createReactActivityDelegate() { 25 | return new MainActivityDelegate(this, getMainComponentName()); 26 | } 27 | 28 | public static class MainActivityDelegate extends ReactActivityDelegate { 29 | public MainActivityDelegate(ReactActivity activity, String mainComponentName) { 30 | super(activity, mainComponentName); 31 | } 32 | 33 | @Override 34 | protected ReactRootView createRootView() { 35 | ReactRootView reactRootView = new ReactRootView(getContext()); 36 | // If you opted-in for the New Architecture, we enable the Fabric Renderer. 37 | reactRootView.setIsFabric(BuildConfig.IS_NEW_ARCHITECTURE_ENABLED); 38 | return reactRootView; 39 | } 40 | 41 | @Override 42 | protected boolean isConcurrentRootEnabled() { 43 | // If you opted-in for the New Architecture, we enable Concurrent Root (i.e. React 18). 44 | // More on this on https://reactjs.org/blog/2022/03/29/react-v18.html 45 | return BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rn_example/MainApplication.java: -------------------------------------------------------------------------------- 1 | package com.rn_example; 2 | 3 | import android.app.Application; 4 | import android.content.Context; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactApplication; 7 | import com.facebook.react.ReactInstanceManager; 8 | import com.facebook.react.ReactNativeHost; 9 | import com.facebook.react.ReactPackage; 10 | import com.facebook.react.config.ReactFeatureFlags; 11 | import com.facebook.soloader.SoLoader; 12 | import com.rn_example.newarchitecture.MainApplicationReactNativeHost; 13 | import java.lang.reflect.InvocationTargetException; 14 | import java.util.List; 15 | 16 | public class MainApplication extends Application implements ReactApplication { 17 | 18 | private final ReactNativeHost mReactNativeHost = 19 | new ReactNativeHost(this) { 20 | @Override 21 | public boolean getUseDeveloperSupport() { 22 | return BuildConfig.DEBUG; 23 | } 24 | 25 | @Override 26 | protected List getPackages() { 27 | @SuppressWarnings("UnnecessaryLocalVariable") 28 | List packages = new PackageList(this).getPackages(); 29 | // Packages that cannot be autolinked yet can be added manually here, for example: 30 | // packages.add(new MyReactNativePackage()); 31 | return packages; 32 | } 33 | 34 | @Override 35 | protected String getJSMainModuleName() { 36 | return "index"; 37 | } 38 | }; 39 | 40 | private final ReactNativeHost mNewArchitectureNativeHost = 41 | new MainApplicationReactNativeHost(this); 42 | 43 | @Override 44 | public ReactNativeHost getReactNativeHost() { 45 | if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) { 46 | return mNewArchitectureNativeHost; 47 | } else { 48 | return mReactNativeHost; 49 | } 50 | } 51 | 52 | @Override 53 | public void onCreate() { 54 | super.onCreate(); 55 | // If you opted-in for the New Architecture, we enable the TurboModule system 56 | ReactFeatureFlags.useTurboModules = BuildConfig.IS_NEW_ARCHITECTURE_ENABLED; 57 | SoLoader.init(this, /* native exopackage */ false); 58 | initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 59 | } 60 | 61 | /** 62 | * Loads Flipper in React Native templates. Call this in the onCreate method with something like 63 | * initializeFlipper(this, getReactNativeHost().getReactInstanceManager()); 64 | * 65 | * @param context 66 | * @param reactInstanceManager 67 | */ 68 | private static void initializeFlipper( 69 | Context context, ReactInstanceManager reactInstanceManager) { 70 | if (BuildConfig.DEBUG) { 71 | try { 72 | /* 73 | We use reflection here to pick up the class that initializes Flipper, 74 | since Flipper library is not available in release mode 75 | */ 76 | Class aClass = Class.forName("com.rn_example.ReactNativeFlipper"); 77 | aClass 78 | .getMethod("initializeFlipper", Context.class, ReactInstanceManager.class) 79 | .invoke(null, context, reactInstanceManager); 80 | } catch (ClassNotFoundException e) { 81 | e.printStackTrace(); 82 | } catch (NoSuchMethodException e) { 83 | e.printStackTrace(); 84 | } catch (IllegalAccessException e) { 85 | e.printStackTrace(); 86 | } catch (InvocationTargetException e) { 87 | e.printStackTrace(); 88 | } 89 | } 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rn_example/newarchitecture/MainApplicationReactNativeHost.java: -------------------------------------------------------------------------------- 1 | package com.rn_example.newarchitecture; 2 | 3 | import android.app.Application; 4 | import androidx.annotation.NonNull; 5 | import com.facebook.react.PackageList; 6 | import com.facebook.react.ReactInstanceManager; 7 | import com.facebook.react.ReactNativeHost; 8 | import com.facebook.react.ReactPackage; 9 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 10 | import com.facebook.react.bridge.JSIModulePackage; 11 | import com.facebook.react.bridge.JSIModuleProvider; 12 | import com.facebook.react.bridge.JSIModuleSpec; 13 | import com.facebook.react.bridge.JSIModuleType; 14 | import com.facebook.react.bridge.JavaScriptContextHolder; 15 | import com.facebook.react.bridge.ReactApplicationContext; 16 | import com.facebook.react.bridge.UIManager; 17 | import com.facebook.react.fabric.ComponentFactory; 18 | import com.facebook.react.fabric.CoreComponentsRegistry; 19 | import com.facebook.react.fabric.FabricJSIModuleProvider; 20 | import com.facebook.react.fabric.ReactNativeConfig; 21 | import com.facebook.react.uimanager.ViewManagerRegistry; 22 | import com.rn_example.BuildConfig; 23 | import com.rn_example.newarchitecture.components.MainComponentsRegistry; 24 | import com.rn_example.newarchitecture.modules.MainApplicationTurboModuleManagerDelegate; 25 | import java.util.ArrayList; 26 | import java.util.List; 27 | 28 | /** 29 | * A {@link ReactNativeHost} that helps you load everything needed for the New Architecture, both 30 | * TurboModule delegates and the Fabric Renderer. 31 | * 32 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 33 | * `newArchEnabled` property). Is ignored otherwise. 34 | */ 35 | public class MainApplicationReactNativeHost extends ReactNativeHost { 36 | public MainApplicationReactNativeHost(Application application) { 37 | super(application); 38 | } 39 | 40 | @Override 41 | public boolean getUseDeveloperSupport() { 42 | return BuildConfig.DEBUG; 43 | } 44 | 45 | @Override 46 | protected List getPackages() { 47 | List packages = new PackageList(this).getPackages(); 48 | // Packages that cannot be autolinked yet can be added manually here, for example: 49 | // packages.add(new MyReactNativePackage()); 50 | // TurboModules must also be loaded here providing a valid TurboReactPackage implementation: 51 | // packages.add(new TurboReactPackage() { ... }); 52 | // If you have custom Fabric Components, their ViewManagers should also be loaded here 53 | // inside a ReactPackage. 54 | return packages; 55 | } 56 | 57 | @Override 58 | protected String getJSMainModuleName() { 59 | return "index"; 60 | } 61 | 62 | @NonNull 63 | @Override 64 | protected ReactPackageTurboModuleManagerDelegate.Builder 65 | getReactPackageTurboModuleManagerDelegateBuilder() { 66 | // Here we provide the ReactPackageTurboModuleManagerDelegate Builder. This is necessary 67 | // for the new architecture and to use TurboModules correctly. 68 | return new MainApplicationTurboModuleManagerDelegate.Builder(); 69 | } 70 | 71 | @Override 72 | protected JSIModulePackage getJSIModulePackage() { 73 | return new JSIModulePackage() { 74 | @Override 75 | public List getJSIModules( 76 | final ReactApplicationContext reactApplicationContext, 77 | final JavaScriptContextHolder jsContext) { 78 | final List specs = new ArrayList<>(); 79 | 80 | // Here we provide a new JSIModuleSpec that will be responsible of providing the 81 | // custom Fabric Components. 82 | specs.add( 83 | new JSIModuleSpec() { 84 | @Override 85 | public JSIModuleType getJSIModuleType() { 86 | return JSIModuleType.UIManager; 87 | } 88 | 89 | @Override 90 | public JSIModuleProvider getJSIModuleProvider() { 91 | final ComponentFactory componentFactory = new ComponentFactory(); 92 | CoreComponentsRegistry.register(componentFactory); 93 | 94 | // Here we register a Components Registry. 95 | // The one that is generated with the template contains no components 96 | // and just provides you the one from React Native core. 97 | MainComponentsRegistry.register(componentFactory); 98 | 99 | final ReactInstanceManager reactInstanceManager = getReactInstanceManager(); 100 | 101 | ViewManagerRegistry viewManagerRegistry = 102 | new ViewManagerRegistry( 103 | reactInstanceManager.getOrCreateViewManagers(reactApplicationContext)); 104 | 105 | return new FabricJSIModuleProvider( 106 | reactApplicationContext, 107 | componentFactory, 108 | ReactNativeConfig.DEFAULT_CONFIG, 109 | viewManagerRegistry); 110 | } 111 | }); 112 | return specs; 113 | } 114 | }; 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rn_example/newarchitecture/components/MainComponentsRegistry.java: -------------------------------------------------------------------------------- 1 | package com.rn_example.newarchitecture.components; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.proguard.annotations.DoNotStrip; 5 | import com.facebook.react.fabric.ComponentFactory; 6 | import com.facebook.soloader.SoLoader; 7 | 8 | /** 9 | * Class responsible to load the custom Fabric Components. This class has native methods and needs a 10 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 11 | * folder for you). 12 | * 13 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 14 | * `newArchEnabled` property). Is ignored otherwise. 15 | */ 16 | @DoNotStrip 17 | public class MainComponentsRegistry { 18 | static { 19 | SoLoader.loadLibrary("fabricjni"); 20 | } 21 | 22 | @DoNotStrip private final HybridData mHybridData; 23 | 24 | @DoNotStrip 25 | private native HybridData initHybrid(ComponentFactory componentFactory); 26 | 27 | @DoNotStrip 28 | private MainComponentsRegistry(ComponentFactory componentFactory) { 29 | mHybridData = initHybrid(componentFactory); 30 | } 31 | 32 | @DoNotStrip 33 | public static MainComponentsRegistry register(ComponentFactory componentFactory) { 34 | return new MainComponentsRegistry(componentFactory); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/java/com/rn_example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate.java: -------------------------------------------------------------------------------- 1 | package com.rn_example.newarchitecture.modules; 2 | 3 | import com.facebook.jni.HybridData; 4 | import com.facebook.react.ReactPackage; 5 | import com.facebook.react.ReactPackageTurboModuleManagerDelegate; 6 | import com.facebook.react.bridge.ReactApplicationContext; 7 | import com.facebook.soloader.SoLoader; 8 | import java.util.List; 9 | 10 | /** 11 | * Class responsible to load the TurboModules. This class has native methods and needs a 12 | * corresponding C++ implementation/header file to work correctly (already placed inside the jni/ 13 | * folder for you). 14 | * 15 | *

Please note that this class is used ONLY if you opt-in for the New Architecture (see the 16 | * `newArchEnabled` property). Is ignored otherwise. 17 | */ 18 | public class MainApplicationTurboModuleManagerDelegate 19 | extends ReactPackageTurboModuleManagerDelegate { 20 | 21 | private static volatile boolean sIsSoLibraryLoaded; 22 | 23 | protected MainApplicationTurboModuleManagerDelegate( 24 | ReactApplicationContext reactApplicationContext, List packages) { 25 | super(reactApplicationContext, packages); 26 | } 27 | 28 | protected native HybridData initHybrid(); 29 | 30 | native boolean canCreateTurboModule(String moduleName); 31 | 32 | public static class Builder extends ReactPackageTurboModuleManagerDelegate.Builder { 33 | protected MainApplicationTurboModuleManagerDelegate build( 34 | ReactApplicationContext context, List packages) { 35 | return new MainApplicationTurboModuleManagerDelegate(context, packages); 36 | } 37 | } 38 | 39 | @Override 40 | protected synchronized void maybeLoadOtherSoLibraries() { 41 | if (!sIsSoLibraryLoaded) { 42 | // If you change the name of your application .so file in the Android.mk file, 43 | // make sure you update the name here as well. 44 | SoLoader.loadLibrary("rn_example_appmodules"); 45 | sIsSoLibraryLoaded = true; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.13) 2 | 3 | # Define the library name here. 4 | project(rn_example_appmodules) 5 | 6 | # This file includes all the necessary to let you build your application with the New Architecture. 7 | include(${REACT_ANDROID_DIR}/cmake-utils/ReactNative-application.cmake) 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationModuleProvider.h" 2 | 3 | #include 4 | #include 5 | 6 | namespace facebook { 7 | namespace react { 8 | 9 | std::shared_ptr MainApplicationModuleProvider( 10 | const std::string &moduleName, 11 | const JavaTurboModule::InitParams ¶ms) { 12 | // Here you can provide your own module provider for TurboModules coming from 13 | // either your application or from external libraries. The approach to follow 14 | // is similar to the following (for a library called `samplelibrary`: 15 | // 16 | // auto module = samplelibrary_ModuleProvider(moduleName, params); 17 | // if (module != nullptr) { 18 | // return module; 19 | // } 20 | // return rncore_ModuleProvider(moduleName, params); 21 | 22 | // Module providers autolinked by RN CLI 23 | auto rncli_module = rncli_ModuleProvider(moduleName, params); 24 | if (rncli_module != nullptr) { 25 | return rncli_module; 26 | } 27 | 28 | return rncore_ModuleProvider(moduleName, params); 29 | } 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationModuleProvider.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | std::shared_ptr MainApplicationModuleProvider( 12 | const std::string &moduleName, 13 | const JavaTurboModule::InitParams ¶ms); 14 | 15 | } // namespace react 16 | } // namespace facebook 17 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.cpp: -------------------------------------------------------------------------------- 1 | #include "MainApplicationTurboModuleManagerDelegate.h" 2 | #include "MainApplicationModuleProvider.h" 3 | 4 | namespace facebook { 5 | namespace react { 6 | 7 | jni::local_ref 8 | MainApplicationTurboModuleManagerDelegate::initHybrid( 9 | jni::alias_ref) { 10 | return makeCxxInstance(); 11 | } 12 | 13 | void MainApplicationTurboModuleManagerDelegate::registerNatives() { 14 | registerHybrid({ 15 | makeNativeMethod( 16 | "initHybrid", MainApplicationTurboModuleManagerDelegate::initHybrid), 17 | makeNativeMethod( 18 | "canCreateTurboModule", 19 | MainApplicationTurboModuleManagerDelegate::canCreateTurboModule), 20 | }); 21 | } 22 | 23 | std::shared_ptr 24 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 25 | const std::string &name, 26 | const std::shared_ptr &jsInvoker) { 27 | // Not implemented yet: provide pure-C++ NativeModules here. 28 | return nullptr; 29 | } 30 | 31 | std::shared_ptr 32 | MainApplicationTurboModuleManagerDelegate::getTurboModule( 33 | const std::string &name, 34 | const JavaTurboModule::InitParams ¶ms) { 35 | return MainApplicationModuleProvider(name, params); 36 | } 37 | 38 | bool MainApplicationTurboModuleManagerDelegate::canCreateTurboModule( 39 | const std::string &name) { 40 | return getTurboModule(name, nullptr) != nullptr || 41 | getTurboModule(name, {.moduleName = name}) != nullptr; 42 | } 43 | 44 | } // namespace react 45 | } // namespace facebook 46 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainApplicationTurboModuleManagerDelegate.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | 7 | namespace facebook { 8 | namespace react { 9 | 10 | class MainApplicationTurboModuleManagerDelegate 11 | : public jni::HybridClass< 12 | MainApplicationTurboModuleManagerDelegate, 13 | TurboModuleManagerDelegate> { 14 | public: 15 | // Adapt it to the package you used for your Java class. 16 | static constexpr auto kJavaDescriptor = 17 | "Lcom/rn_example/newarchitecture/modules/MainApplicationTurboModuleManagerDelegate;"; 18 | 19 | static jni::local_ref initHybrid(jni::alias_ref); 20 | 21 | static void registerNatives(); 22 | 23 | std::shared_ptr getTurboModule( 24 | const std::string &name, 25 | const std::shared_ptr &jsInvoker) override; 26 | std::shared_ptr getTurboModule( 27 | const std::string &name, 28 | const JavaTurboModule::InitParams ¶ms) override; 29 | 30 | /** 31 | * Test-only method. Allows user to verify whether a TurboModule can be 32 | * created by instances of this class. 33 | */ 34 | bool canCreateTurboModule(const std::string &name); 35 | }; 36 | 37 | } // namespace react 38 | } // namespace facebook 39 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainComponentsRegistry.cpp: -------------------------------------------------------------------------------- 1 | #include "MainComponentsRegistry.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | namespace facebook { 10 | namespace react { 11 | 12 | MainComponentsRegistry::MainComponentsRegistry(ComponentFactory *delegate) {} 13 | 14 | std::shared_ptr 15 | MainComponentsRegistry::sharedProviderRegistry() { 16 | auto providerRegistry = CoreComponentsRegistry::sharedProviderRegistry(); 17 | 18 | // Autolinked providers registered by RN CLI 19 | rncli_registerProviders(providerRegistry); 20 | 21 | // Custom Fabric Components go here. You can register custom 22 | // components coming from your App or from 3rd party libraries here. 23 | // 24 | // providerRegistry->add(concreteComponentDescriptorProvider< 25 | // AocViewerComponentDescriptor>()); 26 | return providerRegistry; 27 | } 28 | 29 | jni::local_ref 30 | MainComponentsRegistry::initHybrid( 31 | jni::alias_ref, 32 | ComponentFactory *delegate) { 33 | auto instance = makeCxxInstance(delegate); 34 | 35 | auto buildRegistryFunction = 36 | [](EventDispatcher::Weak const &eventDispatcher, 37 | ContextContainer::Shared const &contextContainer) 38 | -> ComponentDescriptorRegistry::Shared { 39 | auto registry = MainComponentsRegistry::sharedProviderRegistry() 40 | ->createComponentDescriptorRegistry( 41 | {eventDispatcher, contextContainer}); 42 | 43 | auto mutableRegistry = 44 | std::const_pointer_cast(registry); 45 | 46 | mutableRegistry->setFallbackComponentDescriptor( 47 | std::make_shared( 48 | ComponentDescriptorParameters{ 49 | eventDispatcher, contextContainer, nullptr})); 50 | 51 | return registry; 52 | }; 53 | 54 | delegate->buildRegistryFunction = buildRegistryFunction; 55 | return instance; 56 | } 57 | 58 | void MainComponentsRegistry::registerNatives() { 59 | registerHybrid({ 60 | makeNativeMethod("initHybrid", MainComponentsRegistry::initHybrid), 61 | }); 62 | } 63 | 64 | } // namespace react 65 | } // namespace facebook 66 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/MainComponentsRegistry.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace facebook { 9 | namespace react { 10 | 11 | class MainComponentsRegistry 12 | : public facebook::jni::HybridClass { 13 | public: 14 | // Adapt it to the package you used for your Java class. 15 | constexpr static auto kJavaDescriptor = 16 | "Lcom/rn_example/newarchitecture/components/MainComponentsRegistry;"; 17 | 18 | static void registerNatives(); 19 | 20 | MainComponentsRegistry(ComponentFactory *delegate); 21 | 22 | private: 23 | static std::shared_ptr 24 | sharedProviderRegistry(); 25 | 26 | static jni::local_ref initHybrid( 27 | jni::alias_ref, 28 | ComponentFactory *delegate); 29 | }; 30 | 31 | } // namespace react 32 | } // namespace facebook 33 | -------------------------------------------------------------------------------- /example/android/app/src/main/jni/OnLoad.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "MainApplicationTurboModuleManagerDelegate.h" 3 | #include "MainComponentsRegistry.h" 4 | 5 | JNIEXPORT jint JNICALL JNI_OnLoad(JavaVM *vm, void *) { 6 | return facebook::jni::initialize(vm, [] { 7 | facebook::react::MainApplicationTurboModuleManagerDelegate:: 8 | registerNatives(); 9 | facebook::react::MainComponentsRegistry::registerNatives(); 10 | }); 11 | } 12 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/rn_edit_text_material.xml: -------------------------------------------------------------------------------- 1 | 2 | 16 | 21 | 22 | 23 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | rn_example 3 | 4 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | 3 | buildscript { 4 | ext { 5 | buildToolsVersion = "31.0.0" 6 | minSdkVersion = 21 7 | compileSdkVersion = 31 8 | targetSdkVersion = 31 9 | 10 | if (System.properties['os.arch'] == "aarch64") { 11 | // For M1 Users we need to use the NDK 24 which added support for aarch64 12 | ndkVersion = "24.0.8215888" 13 | } else { 14 | // Otherwise we default to the side-by-side NDK version from AGP. 15 | ndkVersion = "21.4.7075529" 16 | } 17 | } 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | dependencies { 23 | classpath("com.android.tools.build:gradle:7.2.1") 24 | classpath("com.facebook.react:react-native-gradle-plugin") 25 | classpath("de.undercouch:gradle-download-task:5.0.1") 26 | // NOTE: Do not place your application dependencies here; they belong 27 | // in the individual module build.gradle files 28 | } 29 | } 30 | 31 | allprojects { 32 | repositories { 33 | maven { 34 | // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm 35 | url("$rootDir/../node_modules/react-native/android") 36 | } 37 | maven { 38 | // Android JSC is installed from npm 39 | url("$rootDir/../node_modules/jsc-android/dist") 40 | } 41 | mavenCentral { 42 | // We don't want to fetch react-native from Maven Central as there are 43 | // older versions over there. 44 | content { 45 | excludeGroup "com.facebook.react" 46 | } 47 | } 48 | google() 49 | maven { url 'https://www.jitpack.io' } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | # Default value: -Xmx512m -XX:MaxMetaspaceSize=256m 13 | org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | # AndroidX package structure to make it clearer which packages are bundled with the 21 | # Android operating system, and which are packaged with your app's APK 22 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 23 | android.useAndroidX=true 24 | # Automatically convert third-party libraries to use AndroidX 25 | android.enableJetifier=true 26 | 27 | # Version of flipper SDK to use with React Native 28 | FLIPPER_VERSION=0.125.0 29 | 30 | # Use this property to specify which architecture you want to build. 31 | # You can also override it from the CLI using 32 | # ./gradlew -PreactNativeArchitectures=x86_64 33 | reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64 34 | 35 | # Use this property to enable support to the new architecture. 36 | # This will allow you to use TurboModules and the Fabric render in 37 | # your application. You should enable this flag either if you want 38 | # to write custom TurboModules/Fabric components OR use libraries that 39 | # are providing them. 40 | newArchEnabled=false 41 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /example/android/gradlew: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Copyright © 2015-2021 the original authors. 5 | # 6 | # Licensed under the Apache License, Version 2.0 (the "License"); 7 | # you may not use this file except in compliance with the License. 8 | # You may obtain a copy of the License at 9 | # 10 | # https://www.apache.org/licenses/LICENSE-2.0 11 | # 12 | # Unless required by applicable law or agreed to in writing, software 13 | # distributed under the License is distributed on an "AS IS" BASIS, 14 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 | # See the License for the specific language governing permissions and 16 | # limitations under the License. 17 | # 18 | 19 | ############################################################################## 20 | # 21 | # Gradle start up script for POSIX generated by Gradle. 22 | # 23 | # Important for running: 24 | # 25 | # (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is 26 | # noncompliant, but you have some other compliant shell such as ksh or 27 | # bash, then to run this script, type that shell name before the whole 28 | # command line, like: 29 | # 30 | # ksh Gradle 31 | # 32 | # Busybox and similar reduced shells will NOT work, because this script 33 | # requires all of these POSIX shell features: 34 | # * functions; 35 | # * expansions «$var», «${var}», «${var:-default}», «${var+SET}», 36 | # «${var#prefix}», «${var%suffix}», and «$( cmd )»; 37 | # * compound commands having a testable exit status, especially «case»; 38 | # * various built-in commands including «command», «set», and «ulimit». 39 | # 40 | # Important for patching: 41 | # 42 | # (2) This script targets any POSIX shell, so it avoids extensions provided 43 | # by Bash, Ksh, etc; in particular arrays are avoided. 44 | # 45 | # The "traditional" practice of packing multiple parameters into a 46 | # space-separated string is a well documented source of bugs and security 47 | # problems, so this is (mostly) avoided, by progressively accumulating 48 | # options in "$@", and eventually passing that to Java. 49 | # 50 | # Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS, 51 | # and GRADLE_OPTS) rely on word-splitting, this is performed explicitly; 52 | # see the in-line comments for details. 53 | # 54 | # There are tweaks for specific operating systems such as AIX, CygWin, 55 | # Darwin, MinGW, and NonStop. 56 | # 57 | # (3) This script is generated from the Groovy template 58 | # https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt 59 | # within the Gradle project. 60 | # 61 | # You can find Gradle at https://github.com/gradle/gradle/. 62 | # 63 | ############################################################################## 64 | 65 | # Attempt to set APP_HOME 66 | 67 | # Resolve links: $0 may be a link 68 | app_path=$0 69 | 70 | # Need this for daisy-chained symlinks. 71 | while 72 | APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path 73 | [ -h "$app_path" ] 74 | do 75 | ls=$( ls -ld "$app_path" ) 76 | link=${ls#*' -> '} 77 | case $link in #( 78 | /*) app_path=$link ;; #( 79 | *) app_path=$APP_HOME$link ;; 80 | esac 81 | done 82 | 83 | APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit 84 | 85 | APP_NAME="Gradle" 86 | APP_BASE_NAME=${0##*/} 87 | 88 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 89 | DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"' 90 | 91 | # Use the maximum available, or set MAX_FD != -1 to use that value. 92 | MAX_FD=maximum 93 | 94 | warn () { 95 | echo "$*" 96 | } >&2 97 | 98 | die () { 99 | echo 100 | echo "$*" 101 | echo 102 | exit 1 103 | } >&2 104 | 105 | # OS specific support (must be 'true' or 'false'). 106 | cygwin=false 107 | msys=false 108 | darwin=false 109 | nonstop=false 110 | case "$( uname )" in #( 111 | CYGWIN* ) cygwin=true ;; #( 112 | Darwin* ) darwin=true ;; #( 113 | MSYS* | MINGW* ) msys=true ;; #( 114 | NONSTOP* ) nonstop=true ;; 115 | esac 116 | 117 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 118 | 119 | 120 | # Determine the Java command to use to start the JVM. 121 | if [ -n "$JAVA_HOME" ] ; then 122 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 123 | # IBM's JDK on AIX uses strange locations for the executables 124 | JAVACMD=$JAVA_HOME/jre/sh/java 125 | else 126 | JAVACMD=$JAVA_HOME/bin/java 127 | fi 128 | if [ ! -x "$JAVACMD" ] ; then 129 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 130 | 131 | Please set the JAVA_HOME variable in your environment to match the 132 | location of your Java installation." 133 | fi 134 | else 135 | JAVACMD=java 136 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 137 | 138 | Please set the JAVA_HOME variable in your environment to match the 139 | location of your Java installation." 140 | fi 141 | 142 | # Increase the maximum file descriptors if we can. 143 | if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then 144 | case $MAX_FD in #( 145 | max*) 146 | MAX_FD=$( ulimit -H -n ) || 147 | warn "Could not query maximum file descriptor limit" 148 | esac 149 | case $MAX_FD in #( 150 | '' | soft) :;; #( 151 | *) 152 | ulimit -n "$MAX_FD" || 153 | warn "Could not set maximum file descriptor limit to $MAX_FD" 154 | esac 155 | fi 156 | 157 | # Collect all arguments for the java command, stacking in reverse order: 158 | # * args from the command line 159 | # * the main class name 160 | # * -classpath 161 | # * -D...appname settings 162 | # * --module-path (only if needed) 163 | # * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables. 164 | 165 | # For Cygwin or MSYS, switch paths to Windows format before running java 166 | if "$cygwin" || "$msys" ; then 167 | APP_HOME=$( cygpath --path --mixed "$APP_HOME" ) 168 | CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" ) 169 | 170 | JAVACMD=$( cygpath --unix "$JAVACMD" ) 171 | 172 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 173 | for arg do 174 | if 175 | case $arg in #( 176 | -*) false ;; # don't mess with options #( 177 | /?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath 178 | [ -e "$t" ] ;; #( 179 | *) false ;; 180 | esac 181 | then 182 | arg=$( cygpath --path --ignore --mixed "$arg" ) 183 | fi 184 | # Roll the args list around exactly as many times as the number of 185 | # args, so each arg winds up back in the position where it started, but 186 | # possibly modified. 187 | # 188 | # NB: a `for` loop captures its iteration list before it begins, so 189 | # changing the positional parameters here affects neither the number of 190 | # iterations, nor the values presented in `arg`. 191 | shift # remove old arg 192 | set -- "$@" "$arg" # push replacement arg 193 | done 194 | fi 195 | 196 | # Collect all arguments for the java command; 197 | # * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of 198 | # shell script including quotes and variable substitutions, so put them in 199 | # double quotes to make sure that they get re-expanded; and 200 | # * put everything else in single quotes, so that it's not re-expanded. 201 | 202 | set -- \ 203 | "-Dorg.gradle.appname=$APP_BASE_NAME" \ 204 | -classpath "$CLASSPATH" \ 205 | org.gradle.wrapper.GradleWrapperMain \ 206 | "$@" 207 | 208 | # Use "xargs" to parse quoted args. 209 | # 210 | # With -n1 it outputs one arg per line, with the quotes and backslashes removed. 211 | # 212 | # In Bash we could simply go: 213 | # 214 | # readarray ARGS < <( xargs -n1 <<<"$var" ) && 215 | # set -- "${ARGS[@]}" "$@" 216 | # 217 | # but POSIX shell has neither arrays nor command substitution, so instead we 218 | # post-process each arg (as a line of input to sed) to backslash-escape any 219 | # character that might be a shell metacharacter, then use eval to reverse 220 | # that process (while maintaining the separation between arguments), and wrap 221 | # the whole thing up as a single "set" statement. 222 | # 223 | # This will of course break if any of these variables contains a newline or 224 | # an unmatched quote. 225 | # 226 | 227 | eval "set -- $( 228 | printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" | 229 | xargs -n1 | 230 | sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' | 231 | tr '\n' ' ' 232 | )" '"$@"' 233 | 234 | exec "$JAVACMD" "$@" 235 | -------------------------------------------------------------------------------- /example/android/gradlew.bat: -------------------------------------------------------------------------------- 1 | @rem 2 | @rem Copyright 2015 the original author or authors. 3 | @rem 4 | @rem Licensed under the Apache License, Version 2.0 (the "License"); 5 | @rem you may not use this file except in compliance with the License. 6 | @rem You may obtain a copy of the License at 7 | @rem 8 | @rem https://www.apache.org/licenses/LICENSE-2.0 9 | @rem 10 | @rem Unless required by applicable law or agreed to in writing, software 11 | @rem distributed under the License is distributed on an "AS IS" BASIS, 12 | @rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | @rem See the License for the specific language governing permissions and 14 | @rem limitations under the License. 15 | @rem 16 | 17 | @if "%DEBUG%" == "" @echo off 18 | @rem ########################################################################## 19 | @rem 20 | @rem Gradle startup script for Windows 21 | @rem 22 | @rem ########################################################################## 23 | 24 | @rem Set local scope for the variables with windows NT shell 25 | if "%OS%"=="Windows_NT" setlocal 26 | 27 | set DIRNAME=%~dp0 28 | if "%DIRNAME%" == "" set DIRNAME=. 29 | set APP_BASE_NAME=%~n0 30 | set APP_HOME=%DIRNAME% 31 | 32 | @rem Resolve any "." and ".." in APP_HOME to make it shorter. 33 | for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi 34 | 35 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 36 | set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" 37 | 38 | @rem Find java.exe 39 | if defined JAVA_HOME goto findJavaFromJavaHome 40 | 41 | set JAVA_EXE=java.exe 42 | %JAVA_EXE% -version >NUL 2>&1 43 | if "%ERRORLEVEL%" == "0" goto execute 44 | 45 | echo. 46 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 47 | echo. 48 | echo Please set the JAVA_HOME variable in your environment to match the 49 | echo location of your Java installation. 50 | 51 | goto fail 52 | 53 | :findJavaFromJavaHome 54 | set JAVA_HOME=%JAVA_HOME:"=% 55 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 56 | 57 | if exist "%JAVA_EXE%" goto execute 58 | 59 | echo. 60 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 61 | echo. 62 | echo Please set the JAVA_HOME variable in your environment to match the 63 | echo location of your Java installation. 64 | 65 | goto fail 66 | 67 | :execute 68 | @rem Setup the command line 69 | 70 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 71 | 72 | 73 | @rem Execute Gradle 74 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %* 75 | 76 | :end 77 | @rem End local scope for the variables with windows NT shell 78 | if "%ERRORLEVEL%"=="0" goto mainEnd 79 | 80 | :fail 81 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 82 | rem the _cmd.exe /c_ return code! 83 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 84 | exit /b 1 85 | 86 | :mainEnd 87 | if "%OS%"=="Windows_NT" endlocal 88 | 89 | :omega 90 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'rn_example' 2 | apply from: file("../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesSettingsGradle(settings) 3 | include ':app' 4 | includeBuild('../node_modules/react-native-gradle-plugin') 5 | 6 | if (settings.hasProperty("newArchEnabled") && settings.newArchEnabled == "true") { 7 | include(":ReactAndroid") 8 | project(":ReactAndroid").projectDir = file('../node_modules/react-native/ReactAndroid') 9 | include(":ReactAndroid:hermes-engine") 10 | project(":ReactAndroid:hermes-engine").projectDir = file('../node_modules/react-native/ReactAndroid/hermes-engine') 11 | } 12 | -------------------------------------------------------------------------------- /example/app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rn_example", 3 | "displayName": "rn_example" 4 | } -------------------------------------------------------------------------------- /example/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: ['module:metro-react-native-babel-preset'], 3 | plugins: ['react-native-reanimated/plugin'], 4 | }; 5 | -------------------------------------------------------------------------------- /example/index.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @format 3 | */ 4 | 5 | import { AppRegistry } from 'react-native'; 6 | import { name as appName } from './app.json'; 7 | import App from './src/App'; 8 | import 'react-native-gesture-handler'; 9 | 10 | AppRegistry.registerComponent(appName, () => App); 11 | -------------------------------------------------------------------------------- /example/ios/.xcode.env: -------------------------------------------------------------------------------- 1 | # This `.xcode.env` file is versioned and is used to source the environment 2 | # used when running script phases inside Xcode. 3 | # To customize your local environment, you can create an `.xcode.env.local` 4 | # file that is not versioned. 5 | 6 | # NODE_BINARY variable contains the PATH to the node executable. 7 | # 8 | # Customize the NODE_BINARY variable here. 9 | # For example, to use nvm with brew, add the following line 10 | # . "$(brew --prefix nvm)/nvm.sh" --no-use 11 | export NODE_BINARY=$(command -v node) 12 | -------------------------------------------------------------------------------- /example/ios/Podfile: -------------------------------------------------------------------------------- 1 | require_relative '../node_modules/react-native/scripts/react_native_pods' 2 | require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' 3 | 4 | platform :ios, '12.4' 5 | install! 'cocoapods', :deterministic_uuids => false 6 | 7 | target 'rn_example' do 8 | config = use_native_modules! 9 | 10 | # Flags change depending on the env values. 11 | flags = get_default_flags() 12 | 13 | use_react_native!( 14 | :path => config[:reactNativePath], 15 | # Hermes is now enabled by default. Disable by setting this flag to false. 16 | # Upcoming versions of React Native may rely on get_default_flags(), but 17 | # we make it explicit here to aid in the React Native upgrade process. 18 | :hermes_enabled => false, 19 | # :fabric_enabled => flags[:fabric_enabled], 20 | # Enables Flipper. 21 | # 22 | # Note that if you have use_frameworks! enabled, Flipper will not work and 23 | # you should disable the next line. 24 | # :flipper_configuration => FlipperConfiguration.enabled, 25 | # An absolute path to your application root. 26 | :app_path => "#{Pod::Config.instance.installation_root}/.." 27 | ) 28 | 29 | target 'rn_exampleTests' do 30 | inherit! :complete 31 | # Pods for testing 32 | end 33 | 34 | post_install do |installer| 35 | react_native_post_install( 36 | installer, 37 | # Set `mac_catalyst_enabled` to `true` in order to apply patches 38 | # necessary for Mac Catalyst builds 39 | :mac_catalyst_enabled => false 40 | ) 41 | __apply_Xcode_12_5_M1_post_install_workaround(installer) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - boost (1.76.0) 3 | - DoubleConversion (1.1.6) 4 | - FBLazyVector (0.70.0) 5 | - FBReactNativeSpec (0.70.0): 6 | - RCT-Folly (= 2021.07.22.00) 7 | - RCTRequired (= 0.70.0) 8 | - RCTTypeSafety (= 0.70.0) 9 | - React-Core (= 0.70.0) 10 | - React-jsi (= 0.70.0) 11 | - ReactCommon/turbomodule/core (= 0.70.0) 12 | - fmt (6.2.1) 13 | - glog (0.3.5) 14 | - RCT-Folly (2021.07.22.00): 15 | - boost 16 | - DoubleConversion 17 | - fmt (~> 6.2.1) 18 | - glog 19 | - RCT-Folly/Default (= 2021.07.22.00) 20 | - RCT-Folly/Default (2021.07.22.00): 21 | - boost 22 | - DoubleConversion 23 | - fmt (~> 6.2.1) 24 | - glog 25 | - RCTRequired (0.70.0) 26 | - RCTTypeSafety (0.70.0): 27 | - FBLazyVector (= 0.70.0) 28 | - RCTRequired (= 0.70.0) 29 | - React-Core (= 0.70.0) 30 | - React (0.70.0): 31 | - React-Core (= 0.70.0) 32 | - React-Core/DevSupport (= 0.70.0) 33 | - React-Core/RCTWebSocket (= 0.70.0) 34 | - React-RCTActionSheet (= 0.70.0) 35 | - React-RCTAnimation (= 0.70.0) 36 | - React-RCTBlob (= 0.70.0) 37 | - React-RCTImage (= 0.70.0) 38 | - React-RCTLinking (= 0.70.0) 39 | - React-RCTNetwork (= 0.70.0) 40 | - React-RCTSettings (= 0.70.0) 41 | - React-RCTText (= 0.70.0) 42 | - React-RCTVibration (= 0.70.0) 43 | - React-bridging (0.70.0): 44 | - RCT-Folly (= 2021.07.22.00) 45 | - React-jsi (= 0.70.0) 46 | - React-callinvoker (0.70.0) 47 | - React-Codegen (0.70.0): 48 | - FBReactNativeSpec (= 0.70.0) 49 | - RCT-Folly (= 2021.07.22.00) 50 | - RCTRequired (= 0.70.0) 51 | - RCTTypeSafety (= 0.70.0) 52 | - React-Core (= 0.70.0) 53 | - React-jsi (= 0.70.0) 54 | - React-jsiexecutor (= 0.70.0) 55 | - ReactCommon/turbomodule/core (= 0.70.0) 56 | - React-Core (0.70.0): 57 | - glog 58 | - RCT-Folly (= 2021.07.22.00) 59 | - React-Core/Default (= 0.70.0) 60 | - React-cxxreact (= 0.70.0) 61 | - React-jsi (= 0.70.0) 62 | - React-jsiexecutor (= 0.70.0) 63 | - React-perflogger (= 0.70.0) 64 | - Yoga 65 | - React-Core/CoreModulesHeaders (0.70.0): 66 | - glog 67 | - RCT-Folly (= 2021.07.22.00) 68 | - React-Core/Default 69 | - React-cxxreact (= 0.70.0) 70 | - React-jsi (= 0.70.0) 71 | - React-jsiexecutor (= 0.70.0) 72 | - React-perflogger (= 0.70.0) 73 | - Yoga 74 | - React-Core/Default (0.70.0): 75 | - glog 76 | - RCT-Folly (= 2021.07.22.00) 77 | - React-cxxreact (= 0.70.0) 78 | - React-jsi (= 0.70.0) 79 | - React-jsiexecutor (= 0.70.0) 80 | - React-perflogger (= 0.70.0) 81 | - Yoga 82 | - React-Core/DevSupport (0.70.0): 83 | - glog 84 | - RCT-Folly (= 2021.07.22.00) 85 | - React-Core/Default (= 0.70.0) 86 | - React-Core/RCTWebSocket (= 0.70.0) 87 | - React-cxxreact (= 0.70.0) 88 | - React-jsi (= 0.70.0) 89 | - React-jsiexecutor (= 0.70.0) 90 | - React-jsinspector (= 0.70.0) 91 | - React-perflogger (= 0.70.0) 92 | - Yoga 93 | - React-Core/RCTActionSheetHeaders (0.70.0): 94 | - glog 95 | - RCT-Folly (= 2021.07.22.00) 96 | - React-Core/Default 97 | - React-cxxreact (= 0.70.0) 98 | - React-jsi (= 0.70.0) 99 | - React-jsiexecutor (= 0.70.0) 100 | - React-perflogger (= 0.70.0) 101 | - Yoga 102 | - React-Core/RCTAnimationHeaders (0.70.0): 103 | - glog 104 | - RCT-Folly (= 2021.07.22.00) 105 | - React-Core/Default 106 | - React-cxxreact (= 0.70.0) 107 | - React-jsi (= 0.70.0) 108 | - React-jsiexecutor (= 0.70.0) 109 | - React-perflogger (= 0.70.0) 110 | - Yoga 111 | - React-Core/RCTBlobHeaders (0.70.0): 112 | - glog 113 | - RCT-Folly (= 2021.07.22.00) 114 | - React-Core/Default 115 | - React-cxxreact (= 0.70.0) 116 | - React-jsi (= 0.70.0) 117 | - React-jsiexecutor (= 0.70.0) 118 | - React-perflogger (= 0.70.0) 119 | - Yoga 120 | - React-Core/RCTImageHeaders (0.70.0): 121 | - glog 122 | - RCT-Folly (= 2021.07.22.00) 123 | - React-Core/Default 124 | - React-cxxreact (= 0.70.0) 125 | - React-jsi (= 0.70.0) 126 | - React-jsiexecutor (= 0.70.0) 127 | - React-perflogger (= 0.70.0) 128 | - Yoga 129 | - React-Core/RCTLinkingHeaders (0.70.0): 130 | - glog 131 | - RCT-Folly (= 2021.07.22.00) 132 | - React-Core/Default 133 | - React-cxxreact (= 0.70.0) 134 | - React-jsi (= 0.70.0) 135 | - React-jsiexecutor (= 0.70.0) 136 | - React-perflogger (= 0.70.0) 137 | - Yoga 138 | - React-Core/RCTNetworkHeaders (0.70.0): 139 | - glog 140 | - RCT-Folly (= 2021.07.22.00) 141 | - React-Core/Default 142 | - React-cxxreact (= 0.70.0) 143 | - React-jsi (= 0.70.0) 144 | - React-jsiexecutor (= 0.70.0) 145 | - React-perflogger (= 0.70.0) 146 | - Yoga 147 | - React-Core/RCTSettingsHeaders (0.70.0): 148 | - glog 149 | - RCT-Folly (= 2021.07.22.00) 150 | - React-Core/Default 151 | - React-cxxreact (= 0.70.0) 152 | - React-jsi (= 0.70.0) 153 | - React-jsiexecutor (= 0.70.0) 154 | - React-perflogger (= 0.70.0) 155 | - Yoga 156 | - React-Core/RCTTextHeaders (0.70.0): 157 | - glog 158 | - RCT-Folly (= 2021.07.22.00) 159 | - React-Core/Default 160 | - React-cxxreact (= 0.70.0) 161 | - React-jsi (= 0.70.0) 162 | - React-jsiexecutor (= 0.70.0) 163 | - React-perflogger (= 0.70.0) 164 | - Yoga 165 | - React-Core/RCTVibrationHeaders (0.70.0): 166 | - glog 167 | - RCT-Folly (= 2021.07.22.00) 168 | - React-Core/Default 169 | - React-cxxreact (= 0.70.0) 170 | - React-jsi (= 0.70.0) 171 | - React-jsiexecutor (= 0.70.0) 172 | - React-perflogger (= 0.70.0) 173 | - Yoga 174 | - React-Core/RCTWebSocket (0.70.0): 175 | - glog 176 | - RCT-Folly (= 2021.07.22.00) 177 | - React-Core/Default (= 0.70.0) 178 | - React-cxxreact (= 0.70.0) 179 | - React-jsi (= 0.70.0) 180 | - React-jsiexecutor (= 0.70.0) 181 | - React-perflogger (= 0.70.0) 182 | - Yoga 183 | - React-CoreModules (0.70.0): 184 | - RCT-Folly (= 2021.07.22.00) 185 | - RCTTypeSafety (= 0.70.0) 186 | - React-Codegen (= 0.70.0) 187 | - React-Core/CoreModulesHeaders (= 0.70.0) 188 | - React-jsi (= 0.70.0) 189 | - React-RCTImage (= 0.70.0) 190 | - ReactCommon/turbomodule/core (= 0.70.0) 191 | - React-cxxreact (0.70.0): 192 | - boost (= 1.76.0) 193 | - DoubleConversion 194 | - glog 195 | - RCT-Folly (= 2021.07.22.00) 196 | - React-callinvoker (= 0.70.0) 197 | - React-jsi (= 0.70.0) 198 | - React-jsinspector (= 0.70.0) 199 | - React-logger (= 0.70.0) 200 | - React-perflogger (= 0.70.0) 201 | - React-runtimeexecutor (= 0.70.0) 202 | - React-jsi (0.70.0): 203 | - boost (= 1.76.0) 204 | - DoubleConversion 205 | - glog 206 | - RCT-Folly (= 2021.07.22.00) 207 | - React-jsi/Default (= 0.70.0) 208 | - React-jsi/Default (0.70.0): 209 | - boost (= 1.76.0) 210 | - DoubleConversion 211 | - glog 212 | - RCT-Folly (= 2021.07.22.00) 213 | - React-jsiexecutor (0.70.0): 214 | - DoubleConversion 215 | - glog 216 | - RCT-Folly (= 2021.07.22.00) 217 | - React-cxxreact (= 0.70.0) 218 | - React-jsi (= 0.70.0) 219 | - React-perflogger (= 0.70.0) 220 | - React-jsinspector (0.70.0) 221 | - React-logger (0.70.0): 222 | - glog 223 | - React-perflogger (0.70.0) 224 | - React-RCTActionSheet (0.70.0): 225 | - React-Core/RCTActionSheetHeaders (= 0.70.0) 226 | - React-RCTAnimation (0.70.0): 227 | - RCT-Folly (= 2021.07.22.00) 228 | - RCTTypeSafety (= 0.70.0) 229 | - React-Codegen (= 0.70.0) 230 | - React-Core/RCTAnimationHeaders (= 0.70.0) 231 | - React-jsi (= 0.70.0) 232 | - ReactCommon/turbomodule/core (= 0.70.0) 233 | - React-RCTBlob (0.70.0): 234 | - RCT-Folly (= 2021.07.22.00) 235 | - React-Codegen (= 0.70.0) 236 | - React-Core/RCTBlobHeaders (= 0.70.0) 237 | - React-Core/RCTWebSocket (= 0.70.0) 238 | - React-jsi (= 0.70.0) 239 | - React-RCTNetwork (= 0.70.0) 240 | - ReactCommon/turbomodule/core (= 0.70.0) 241 | - React-RCTImage (0.70.0): 242 | - RCT-Folly (= 2021.07.22.00) 243 | - RCTTypeSafety (= 0.70.0) 244 | - React-Codegen (= 0.70.0) 245 | - React-Core/RCTImageHeaders (= 0.70.0) 246 | - React-jsi (= 0.70.0) 247 | - React-RCTNetwork (= 0.70.0) 248 | - ReactCommon/turbomodule/core (= 0.70.0) 249 | - React-RCTLinking (0.70.0): 250 | - React-Codegen (= 0.70.0) 251 | - React-Core/RCTLinkingHeaders (= 0.70.0) 252 | - React-jsi (= 0.70.0) 253 | - ReactCommon/turbomodule/core (= 0.70.0) 254 | - React-RCTNetwork (0.70.0): 255 | - RCT-Folly (= 2021.07.22.00) 256 | - RCTTypeSafety (= 0.70.0) 257 | - React-Codegen (= 0.70.0) 258 | - React-Core/RCTNetworkHeaders (= 0.70.0) 259 | - React-jsi (= 0.70.0) 260 | - ReactCommon/turbomodule/core (= 0.70.0) 261 | - React-RCTSettings (0.70.0): 262 | - RCT-Folly (= 2021.07.22.00) 263 | - RCTTypeSafety (= 0.70.0) 264 | - React-Codegen (= 0.70.0) 265 | - React-Core/RCTSettingsHeaders (= 0.70.0) 266 | - React-jsi (= 0.70.0) 267 | - ReactCommon/turbomodule/core (= 0.70.0) 268 | - React-RCTText (0.70.0): 269 | - React-Core/RCTTextHeaders (= 0.70.0) 270 | - React-RCTVibration (0.70.0): 271 | - RCT-Folly (= 2021.07.22.00) 272 | - React-Codegen (= 0.70.0) 273 | - React-Core/RCTVibrationHeaders (= 0.70.0) 274 | - React-jsi (= 0.70.0) 275 | - ReactCommon/turbomodule/core (= 0.70.0) 276 | - React-runtimeexecutor (0.70.0): 277 | - React-jsi (= 0.70.0) 278 | - ReactCommon/turbomodule/core (0.70.0): 279 | - DoubleConversion 280 | - glog 281 | - RCT-Folly (= 2021.07.22.00) 282 | - React-bridging (= 0.70.0) 283 | - React-callinvoker (= 0.70.0) 284 | - React-Core (= 0.70.0) 285 | - React-cxxreact (= 0.70.0) 286 | - React-jsi (= 0.70.0) 287 | - React-logger (= 0.70.0) 288 | - React-perflogger (= 0.70.0) 289 | - RNGestureHandler (2.9.0): 290 | - React-Core 291 | - RNReanimated (3.0.2): 292 | - DoubleConversion 293 | - FBLazyVector 294 | - FBReactNativeSpec 295 | - glog 296 | - RCT-Folly 297 | - RCTRequired 298 | - RCTTypeSafety 299 | - React-callinvoker 300 | - React-Core 301 | - React-Core/DevSupport 302 | - React-Core/RCTWebSocket 303 | - React-CoreModules 304 | - React-cxxreact 305 | - React-jsi 306 | - React-jsiexecutor 307 | - React-jsinspector 308 | - React-RCTActionSheet 309 | - React-RCTAnimation 310 | - React-RCTBlob 311 | - React-RCTImage 312 | - React-RCTLinking 313 | - React-RCTNetwork 314 | - React-RCTSettings 315 | - React-RCTText 316 | - ReactCommon/turbomodule/core 317 | - Yoga 318 | - Yoga (1.14.0) 319 | 320 | DEPENDENCIES: 321 | - boost (from `../node_modules/react-native/third-party-podspecs/boost.podspec`) 322 | - DoubleConversion (from `../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec`) 323 | - FBLazyVector (from `../node_modules/react-native/Libraries/FBLazyVector`) 324 | - FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`) 325 | - glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`) 326 | - RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`) 327 | - RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`) 328 | - RCTTypeSafety (from `../node_modules/react-native/Libraries/TypeSafety`) 329 | - React (from `../node_modules/react-native/`) 330 | - React-bridging (from `../node_modules/react-native/ReactCommon`) 331 | - React-callinvoker (from `../node_modules/react-native/ReactCommon/callinvoker`) 332 | - React-Codegen (from `build/generated/ios`) 333 | - React-Core (from `../node_modules/react-native/`) 334 | - React-Core/RCTWebSocket (from `../node_modules/react-native/`) 335 | - React-CoreModules (from `../node_modules/react-native/React/CoreModules`) 336 | - React-cxxreact (from `../node_modules/react-native/ReactCommon/cxxreact`) 337 | - React-jsi (from `../node_modules/react-native/ReactCommon/jsi`) 338 | - React-jsiexecutor (from `../node_modules/react-native/ReactCommon/jsiexecutor`) 339 | - React-jsinspector (from `../node_modules/react-native/ReactCommon/jsinspector`) 340 | - React-logger (from `../node_modules/react-native/ReactCommon/logger`) 341 | - React-perflogger (from `../node_modules/react-native/ReactCommon/reactperflogger`) 342 | - React-RCTActionSheet (from `../node_modules/react-native/Libraries/ActionSheetIOS`) 343 | - React-RCTAnimation (from `../node_modules/react-native/Libraries/NativeAnimation`) 344 | - React-RCTBlob (from `../node_modules/react-native/Libraries/Blob`) 345 | - React-RCTImage (from `../node_modules/react-native/Libraries/Image`) 346 | - React-RCTLinking (from `../node_modules/react-native/Libraries/LinkingIOS`) 347 | - React-RCTNetwork (from `../node_modules/react-native/Libraries/Network`) 348 | - React-RCTSettings (from `../node_modules/react-native/Libraries/Settings`) 349 | - React-RCTText (from `../node_modules/react-native/Libraries/Text`) 350 | - React-RCTVibration (from `../node_modules/react-native/Libraries/Vibration`) 351 | - React-runtimeexecutor (from `../node_modules/react-native/ReactCommon/runtimeexecutor`) 352 | - ReactCommon/turbomodule/core (from `../node_modules/react-native/ReactCommon`) 353 | - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) 354 | - RNReanimated (from `../node_modules/react-native-reanimated`) 355 | - Yoga (from `../node_modules/react-native/ReactCommon/yoga`) 356 | 357 | SPEC REPOS: 358 | trunk: 359 | - fmt 360 | 361 | EXTERNAL SOURCES: 362 | boost: 363 | :podspec: "../node_modules/react-native/third-party-podspecs/boost.podspec" 364 | DoubleConversion: 365 | :podspec: "../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec" 366 | FBLazyVector: 367 | :path: "../node_modules/react-native/Libraries/FBLazyVector" 368 | FBReactNativeSpec: 369 | :path: "../node_modules/react-native/React/FBReactNativeSpec" 370 | glog: 371 | :podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec" 372 | RCT-Folly: 373 | :podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec" 374 | RCTRequired: 375 | :path: "../node_modules/react-native/Libraries/RCTRequired" 376 | RCTTypeSafety: 377 | :path: "../node_modules/react-native/Libraries/TypeSafety" 378 | React: 379 | :path: "../node_modules/react-native/" 380 | React-bridging: 381 | :path: "../node_modules/react-native/ReactCommon" 382 | React-callinvoker: 383 | :path: "../node_modules/react-native/ReactCommon/callinvoker" 384 | React-Codegen: 385 | :path: build/generated/ios 386 | React-Core: 387 | :path: "../node_modules/react-native/" 388 | React-CoreModules: 389 | :path: "../node_modules/react-native/React/CoreModules" 390 | React-cxxreact: 391 | :path: "../node_modules/react-native/ReactCommon/cxxreact" 392 | React-jsi: 393 | :path: "../node_modules/react-native/ReactCommon/jsi" 394 | React-jsiexecutor: 395 | :path: "../node_modules/react-native/ReactCommon/jsiexecutor" 396 | React-jsinspector: 397 | :path: "../node_modules/react-native/ReactCommon/jsinspector" 398 | React-logger: 399 | :path: "../node_modules/react-native/ReactCommon/logger" 400 | React-perflogger: 401 | :path: "../node_modules/react-native/ReactCommon/reactperflogger" 402 | React-RCTActionSheet: 403 | :path: "../node_modules/react-native/Libraries/ActionSheetIOS" 404 | React-RCTAnimation: 405 | :path: "../node_modules/react-native/Libraries/NativeAnimation" 406 | React-RCTBlob: 407 | :path: "../node_modules/react-native/Libraries/Blob" 408 | React-RCTImage: 409 | :path: "../node_modules/react-native/Libraries/Image" 410 | React-RCTLinking: 411 | :path: "../node_modules/react-native/Libraries/LinkingIOS" 412 | React-RCTNetwork: 413 | :path: "../node_modules/react-native/Libraries/Network" 414 | React-RCTSettings: 415 | :path: "../node_modules/react-native/Libraries/Settings" 416 | React-RCTText: 417 | :path: "../node_modules/react-native/Libraries/Text" 418 | React-RCTVibration: 419 | :path: "../node_modules/react-native/Libraries/Vibration" 420 | React-runtimeexecutor: 421 | :path: "../node_modules/react-native/ReactCommon/runtimeexecutor" 422 | ReactCommon: 423 | :path: "../node_modules/react-native/ReactCommon" 424 | RNGestureHandler: 425 | :path: "../node_modules/react-native-gesture-handler" 426 | RNReanimated: 427 | :path: "../node_modules/react-native-reanimated" 428 | Yoga: 429 | :path: "../node_modules/react-native/ReactCommon/yoga" 430 | 431 | SPEC CHECKSUMS: 432 | boost: a7c83b31436843459a1961bfd74b96033dc77234 433 | DoubleConversion: 5189b271737e1565bdce30deb4a08d647e3f5f54 434 | FBLazyVector: 6c76fe46345039d5cf0549e9ddaf5aa169630a4a 435 | FBReactNativeSpec: 1a270246542f5c52248cb26a96db119cfe3cb760 436 | fmt: ff9d55029c625d3757ed641535fd4a75fedc7ce9 437 | glog: 04b94705f318337d7ead9e6d17c019bd9b1f6b1b 438 | RCT-Folly: 0080d0a6ebf2577475bda044aa59e2ca1f909cda 439 | RCTRequired: d0e501e8024056451424aa341daa078c0c620b0d 440 | RCTTypeSafety: 14a3928ef69eeb4e5bb4f36fefb5ed6a392643ac 441 | React: a76fa5a8f540c9625fc16cfb3a7bbae9877716d5 442 | React-bridging: 3b8c4365cf22dc668cb4f29eafd83ace49a87835 443 | React-callinvoker: 0b108cf2d78be04f46f5e5fff53acfd019f8b9ab 444 | React-Codegen: 2f3419b3a3c825ccb6a399bcf0db53b9761235ed 445 | React-Core: 0a760f00a2cf3f44324266c227b01594f95ef7a0 446 | React-CoreModules: 4c5bc80e046efcb695d826ba276567051f91321e 447 | React-cxxreact: b07535295fd2c773a681f09d87dcba342e46dc7d 448 | React-jsi: baa181d7aa5867d5438f7969a257846cd7a97559 449 | React-jsiexecutor: be588b7abbea4f1d03840bc675d68d99380e5bf3 450 | React-jsinspector: bd839d6c2c28e49fe1373f055735d2abecbd6cf3 451 | React-logger: 48d82b9be8e44d86668de4453fdb60255516388b 452 | React-perflogger: 77947e49d84e31eb87d454d4ef327542dcfeaebc 453 | React-RCTActionSheet: 9f5fd6c1666c1a834ab7f45a452ed08b1de44eb8 454 | React-RCTAnimation: 6fd3db6ca387c8432fd6a26428e940a081bcb476 455 | React-RCTBlob: 43ff9a00ea606c911c14da74a5bd0a07b54d0c34 456 | React-RCTImage: 10ef13883116c1fd67ec3229d96556893771f747 457 | React-RCTLinking: ff75f970da9e1b0491cfe642f34d8a1ab5338715 458 | React-RCTNetwork: 0528cb19329a0764061ec053c4e3ab8a52ad8741 459 | React-RCTSettings: 26ef15ef3a9019fc09f4f8264f5ca79bf4dfc6de 460 | React-RCTText: 4eeb0a8afd28d691f0bd4c104bf3234d79c78b0c 461 | React-RCTVibration: 5499b77c0fd57f346a5f0b36bb79fdb020d17d3e 462 | React-runtimeexecutor: 80c195ffcafb190f531fdc849dc2d19cb4bb2b34 463 | ReactCommon: de55f940495d7bf87b5d7bf55b5b15cdd50d7d7b 464 | RNGestureHandler: 071d7a9ad81e8b83fe7663b303d132406a7d8f39 465 | RNReanimated: 0a5f87ec1da472cca3e835333fdebe51d983c411 466 | Yoga: 82c9e8f652789f67d98bed5aef9d6653f71b04a9 467 | 468 | PODFILE CHECKSUM: c1d40dd349a40c772b4bfce757662eb2c431113d 469 | 470 | COCOAPODS: 1.11.3 471 | -------------------------------------------------------------------------------- /example/ios/rn_example.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 00E356F31AD99517003FC87E /* rn_exampleTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 00E356F21AD99517003FC87E /* rn_exampleTests.m */; }; 11 | 0C80B921A6F3F58F76C31292 /* libPods-rn_example.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5DCACB8F33CDC322A6C60F78 /* libPods-rn_example.a */; }; 12 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB01A68108700A75B9A /* AppDelegate.mm */; }; 13 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; }; 14 | 13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; }; 15 | 7699B88040F8A987B510C191 /* libPods-rn_example-rn_exampleTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 19F6CBCC0A4E27FBF8BF4A61 /* libPods-rn_example-rn_exampleTests.a */; }; 16 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */; }; 17 | /* End PBXBuildFile section */ 18 | 19 | /* Begin PBXContainerItemProxy section */ 20 | 00E356F41AD99517003FC87E /* PBXContainerItemProxy */ = { 21 | isa = PBXContainerItemProxy; 22 | containerPortal = 83CBB9F71A601CBA00E9B192 /* Project object */; 23 | proxyType = 1; 24 | remoteGlobalIDString = 13B07F861A680F5B00A75B9A; 25 | remoteInfo = rn_example; 26 | }; 27 | /* End PBXContainerItemProxy section */ 28 | 29 | /* Begin PBXFileReference section */ 30 | 00E356EE1AD99517003FC87E /* rn_exampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = rn_exampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 31 | 00E356F11AD99517003FC87E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 32 | 00E356F21AD99517003FC87E /* rn_exampleTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = rn_exampleTests.m; sourceTree = ""; }; 33 | 13B07F961A680F5B00A75B9A /* rn_example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = rn_example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 34 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = AppDelegate.h; path = rn_example/AppDelegate.h; sourceTree = ""; }; 35 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AppDelegate.mm; path = rn_example/AppDelegate.mm; sourceTree = ""; }; 36 | 13B07FB51A68108700A75B9A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Images.xcassets; path = rn_example/Images.xcassets; sourceTree = ""; }; 37 | 13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = rn_example/Info.plist; sourceTree = ""; }; 38 | 13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = rn_example/main.m; sourceTree = ""; }; 39 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-rn_example-rn_exampleTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rn_example-rn_exampleTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 40 | 3B4392A12AC88292D35C810B /* Pods-rn_example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_example.debug.xcconfig"; path = "Target Support Files/Pods-rn_example/Pods-rn_example.debug.xcconfig"; sourceTree = ""; }; 41 | 5709B34CF0A7D63546082F79 /* Pods-rn_example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_example.release.xcconfig"; path = "Target Support Files/Pods-rn_example/Pods-rn_example.release.xcconfig"; sourceTree = ""; }; 42 | 5B7EB9410499542E8C5724F5 /* Pods-rn_example-rn_exampleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_example-rn_exampleTests.debug.xcconfig"; path = "Target Support Files/Pods-rn_example-rn_exampleTests/Pods-rn_example-rn_exampleTests.debug.xcconfig"; sourceTree = ""; }; 43 | 5DCACB8F33CDC322A6C60F78 /* libPods-rn_example.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-rn_example.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = LaunchScreen.storyboard; path = rn_example/LaunchScreen.storyboard; sourceTree = ""; }; 45 | 89C6BE57DB24E9ADA2F236DE /* Pods-rn_example-rn_exampleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-rn_example-rn_exampleTests.release.xcconfig"; path = "Target Support Files/Pods-rn_example-rn_exampleTests/Pods-rn_example-rn_exampleTests.release.xcconfig"; sourceTree = ""; }; 46 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = JavaScriptCore.framework; path = System/Library/Frameworks/JavaScriptCore.framework; sourceTree = SDKROOT; }; 47 | /* End PBXFileReference section */ 48 | 49 | /* Begin PBXFrameworksBuildPhase section */ 50 | 00E356EB1AD99517003FC87E /* Frameworks */ = { 51 | isa = PBXFrameworksBuildPhase; 52 | buildActionMask = 2147483647; 53 | files = ( 54 | 7699B88040F8A987B510C191 /* libPods-rn_example-rn_exampleTests.a in Frameworks */, 55 | ); 56 | runOnlyForDeploymentPostprocessing = 0; 57 | }; 58 | 13B07F8C1A680F5B00A75B9A /* Frameworks */ = { 59 | isa = PBXFrameworksBuildPhase; 60 | buildActionMask = 2147483647; 61 | files = ( 62 | 0C80B921A6F3F58F76C31292 /* libPods-rn_example.a in Frameworks */, 63 | ); 64 | runOnlyForDeploymentPostprocessing = 0; 65 | }; 66 | /* End PBXFrameworksBuildPhase section */ 67 | 68 | /* Begin PBXGroup section */ 69 | 00E356EF1AD99517003FC87E /* rn_exampleTests */ = { 70 | isa = PBXGroup; 71 | children = ( 72 | 00E356F21AD99517003FC87E /* rn_exampleTests.m */, 73 | 00E356F01AD99517003FC87E /* Supporting Files */, 74 | ); 75 | path = rn_exampleTests; 76 | sourceTree = ""; 77 | }; 78 | 00E356F01AD99517003FC87E /* Supporting Files */ = { 79 | isa = PBXGroup; 80 | children = ( 81 | 00E356F11AD99517003FC87E /* Info.plist */, 82 | ); 83 | name = "Supporting Files"; 84 | sourceTree = ""; 85 | }; 86 | 13B07FAE1A68108700A75B9A /* rn_example */ = { 87 | isa = PBXGroup; 88 | children = ( 89 | 13B07FAF1A68108700A75B9A /* AppDelegate.h */, 90 | 13B07FB01A68108700A75B9A /* AppDelegate.mm */, 91 | 13B07FB51A68108700A75B9A /* Images.xcassets */, 92 | 13B07FB61A68108700A75B9A /* Info.plist */, 93 | 81AB9BB72411601600AC10FF /* LaunchScreen.storyboard */, 94 | 13B07FB71A68108700A75B9A /* main.m */, 95 | ); 96 | name = rn_example; 97 | sourceTree = ""; 98 | }; 99 | 2D16E6871FA4F8E400B85C8A /* Frameworks */ = { 100 | isa = PBXGroup; 101 | children = ( 102 | ED297162215061F000B7C4FE /* JavaScriptCore.framework */, 103 | 5DCACB8F33CDC322A6C60F78 /* libPods-rn_example.a */, 104 | 19F6CBCC0A4E27FBF8BF4A61 /* libPods-rn_example-rn_exampleTests.a */, 105 | ); 106 | name = Frameworks; 107 | sourceTree = ""; 108 | }; 109 | 832341AE1AAA6A7D00B99B32 /* Libraries */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | ); 113 | name = Libraries; 114 | sourceTree = ""; 115 | }; 116 | 83CBB9F61A601CBA00E9B192 = { 117 | isa = PBXGroup; 118 | children = ( 119 | 13B07FAE1A68108700A75B9A /* rn_example */, 120 | 832341AE1AAA6A7D00B99B32 /* Libraries */, 121 | 00E356EF1AD99517003FC87E /* rn_exampleTests */, 122 | 83CBBA001A601CBA00E9B192 /* Products */, 123 | 2D16E6871FA4F8E400B85C8A /* Frameworks */, 124 | BBD78D7AC51CEA395F1C20DB /* Pods */, 125 | ); 126 | indentWidth = 2; 127 | sourceTree = ""; 128 | tabWidth = 2; 129 | usesTabs = 0; 130 | }; 131 | 83CBBA001A601CBA00E9B192 /* Products */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 13B07F961A680F5B00A75B9A /* rn_example.app */, 135 | 00E356EE1AD99517003FC87E /* rn_exampleTests.xctest */, 136 | ); 137 | name = Products; 138 | sourceTree = ""; 139 | }; 140 | BBD78D7AC51CEA395F1C20DB /* Pods */ = { 141 | isa = PBXGroup; 142 | children = ( 143 | 3B4392A12AC88292D35C810B /* Pods-rn_example.debug.xcconfig */, 144 | 5709B34CF0A7D63546082F79 /* Pods-rn_example.release.xcconfig */, 145 | 5B7EB9410499542E8C5724F5 /* Pods-rn_example-rn_exampleTests.debug.xcconfig */, 146 | 89C6BE57DB24E9ADA2F236DE /* Pods-rn_example-rn_exampleTests.release.xcconfig */, 147 | ); 148 | path = Pods; 149 | sourceTree = ""; 150 | }; 151 | /* End PBXGroup section */ 152 | 153 | /* Begin PBXNativeTarget section */ 154 | 00E356ED1AD99517003FC87E /* rn_exampleTests */ = { 155 | isa = PBXNativeTarget; 156 | buildConfigurationList = 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "rn_exampleTests" */; 157 | buildPhases = ( 158 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */, 159 | 00E356EA1AD99517003FC87E /* Sources */, 160 | 00E356EB1AD99517003FC87E /* Frameworks */, 161 | 00E356EC1AD99517003FC87E /* Resources */, 162 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */, 163 | ); 164 | buildRules = ( 165 | ); 166 | dependencies = ( 167 | 00E356F51AD99517003FC87E /* PBXTargetDependency */, 168 | ); 169 | name = rn_exampleTests; 170 | productName = rn_exampleTests; 171 | productReference = 00E356EE1AD99517003FC87E /* rn_exampleTests.xctest */; 172 | productType = "com.apple.product-type.bundle.unit-test"; 173 | }; 174 | 13B07F861A680F5B00A75B9A /* rn_example */ = { 175 | isa = PBXNativeTarget; 176 | buildConfigurationList = 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rn_example" */; 177 | buildPhases = ( 178 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */, 179 | FD10A7F022414F080027D42C /* Start Packager */, 180 | 13B07F871A680F5B00A75B9A /* Sources */, 181 | 13B07F8C1A680F5B00A75B9A /* Frameworks */, 182 | 13B07F8E1A680F5B00A75B9A /* Resources */, 183 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, 184 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */, 185 | ); 186 | buildRules = ( 187 | ); 188 | dependencies = ( 189 | ); 190 | name = rn_example; 191 | productName = rn_example; 192 | productReference = 13B07F961A680F5B00A75B9A /* rn_example.app */; 193 | productType = "com.apple.product-type.application"; 194 | }; 195 | /* End PBXNativeTarget section */ 196 | 197 | /* Begin PBXProject section */ 198 | 83CBB9F71A601CBA00E9B192 /* Project object */ = { 199 | isa = PBXProject; 200 | attributes = { 201 | LastUpgradeCheck = 1210; 202 | TargetAttributes = { 203 | 00E356ED1AD99517003FC87E = { 204 | CreatedOnToolsVersion = 6.2; 205 | TestTargetID = 13B07F861A680F5B00A75B9A; 206 | }; 207 | 13B07F861A680F5B00A75B9A = { 208 | LastSwiftMigration = 1120; 209 | }; 210 | }; 211 | }; 212 | buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rn_example" */; 213 | compatibilityVersion = "Xcode 12.0"; 214 | developmentRegion = en; 215 | hasScannedForEncodings = 0; 216 | knownRegions = ( 217 | en, 218 | Base, 219 | ); 220 | mainGroup = 83CBB9F61A601CBA00E9B192; 221 | productRefGroup = 83CBBA001A601CBA00E9B192 /* Products */; 222 | projectDirPath = ""; 223 | projectRoot = ""; 224 | targets = ( 225 | 13B07F861A680F5B00A75B9A /* rn_example */, 226 | 00E356ED1AD99517003FC87E /* rn_exampleTests */, 227 | ); 228 | }; 229 | /* End PBXProject section */ 230 | 231 | /* Begin PBXResourcesBuildPhase section */ 232 | 00E356EC1AD99517003FC87E /* Resources */ = { 233 | isa = PBXResourcesBuildPhase; 234 | buildActionMask = 2147483647; 235 | files = ( 236 | ); 237 | runOnlyForDeploymentPostprocessing = 0; 238 | }; 239 | 13B07F8E1A680F5B00A75B9A /* Resources */ = { 240 | isa = PBXResourcesBuildPhase; 241 | buildActionMask = 2147483647; 242 | files = ( 243 | 81AB9BB82411601600AC10FF /* LaunchScreen.storyboard in Resources */, 244 | 13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | /* End PBXResourcesBuildPhase section */ 249 | 250 | /* Begin PBXShellScriptBuildPhase section */ 251 | 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */ = { 252 | isa = PBXShellScriptBuildPhase; 253 | buildActionMask = 2147483647; 254 | files = ( 255 | ); 256 | inputPaths = ( 257 | "$(SRCROOT)/.xcode.env.local", 258 | "$(SRCROOT)/.xcode.env", 259 | ); 260 | name = "Bundle React Native code and images"; 261 | outputPaths = ( 262 | ); 263 | runOnlyForDeploymentPostprocessing = 0; 264 | shellPath = /bin/sh; 265 | shellScript = "set -e\n\nWITH_ENVIRONMENT=\"../node_modules/react-native/scripts/xcode/with-environment.sh\"\nREACT_NATIVE_XCODE=\"../node_modules/react-native/scripts/react-native-xcode.sh\"\n\n/bin/sh -c \"$WITH_ENVIRONMENT $REACT_NATIVE_XCODE\"\n"; 266 | }; 267 | A55EABD7B0C7F3A422A6CC61 /* [CP] Check Pods Manifest.lock */ = { 268 | isa = PBXShellScriptBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | ); 272 | inputFileListPaths = ( 273 | ); 274 | inputPaths = ( 275 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 276 | "${PODS_ROOT}/Manifest.lock", 277 | ); 278 | name = "[CP] Check Pods Manifest.lock"; 279 | outputFileListPaths = ( 280 | ); 281 | outputPaths = ( 282 | "$(DERIVED_FILE_DIR)/Pods-rn_example-rn_exampleTests-checkManifestLockResult.txt", 283 | ); 284 | runOnlyForDeploymentPostprocessing = 0; 285 | shellPath = /bin/sh; 286 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 287 | showEnvVarsInLog = 0; 288 | }; 289 | C38B50BA6285516D6DCD4F65 /* [CP] Check Pods Manifest.lock */ = { 290 | isa = PBXShellScriptBuildPhase; 291 | buildActionMask = 2147483647; 292 | files = ( 293 | ); 294 | inputFileListPaths = ( 295 | ); 296 | inputPaths = ( 297 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 298 | "${PODS_ROOT}/Manifest.lock", 299 | ); 300 | name = "[CP] Check Pods Manifest.lock"; 301 | outputFileListPaths = ( 302 | ); 303 | outputPaths = ( 304 | "$(DERIVED_FILE_DIR)/Pods-rn_example-checkManifestLockResult.txt", 305 | ); 306 | runOnlyForDeploymentPostprocessing = 0; 307 | shellPath = /bin/sh; 308 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 309 | showEnvVarsInLog = 0; 310 | }; 311 | E235C05ADACE081382539298 /* [CP] Copy Pods Resources */ = { 312 | isa = PBXShellScriptBuildPhase; 313 | buildActionMask = 2147483647; 314 | files = ( 315 | ); 316 | inputFileListPaths = ( 317 | "${PODS_ROOT}/Target Support Files/Pods-rn_example/Pods-rn_example-resources-${CONFIGURATION}-input-files.xcfilelist", 318 | ); 319 | name = "[CP] Copy Pods Resources"; 320 | outputFileListPaths = ( 321 | "${PODS_ROOT}/Target Support Files/Pods-rn_example/Pods-rn_example-resources-${CONFIGURATION}-output-files.xcfilelist", 322 | ); 323 | runOnlyForDeploymentPostprocessing = 0; 324 | shellPath = /bin/sh; 325 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rn_example/Pods-rn_example-resources.sh\"\n"; 326 | showEnvVarsInLog = 0; 327 | }; 328 | F6A41C54EA430FDDC6A6ED99 /* [CP] Copy Pods Resources */ = { 329 | isa = PBXShellScriptBuildPhase; 330 | buildActionMask = 2147483647; 331 | files = ( 332 | ); 333 | inputFileListPaths = ( 334 | "${PODS_ROOT}/Target Support Files/Pods-rn_example-rn_exampleTests/Pods-rn_example-rn_exampleTests-resources-${CONFIGURATION}-input-files.xcfilelist", 335 | ); 336 | name = "[CP] Copy Pods Resources"; 337 | outputFileListPaths = ( 338 | "${PODS_ROOT}/Target Support Files/Pods-rn_example-rn_exampleTests/Pods-rn_example-rn_exampleTests-resources-${CONFIGURATION}-output-files.xcfilelist", 339 | ); 340 | runOnlyForDeploymentPostprocessing = 0; 341 | shellPath = /bin/sh; 342 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-rn_example-rn_exampleTests/Pods-rn_example-rn_exampleTests-resources.sh\"\n"; 343 | showEnvVarsInLog = 0; 344 | }; 345 | FD10A7F022414F080027D42C /* Start Packager */ = { 346 | isa = PBXShellScriptBuildPhase; 347 | buildActionMask = 2147483647; 348 | files = ( 349 | ); 350 | inputFileListPaths = ( 351 | ); 352 | inputPaths = ( 353 | ); 354 | name = "Start Packager"; 355 | outputFileListPaths = ( 356 | ); 357 | outputPaths = ( 358 | ); 359 | runOnlyForDeploymentPostprocessing = 0; 360 | shellPath = /bin/sh; 361 | shellScript = "export RCT_METRO_PORT=\"${RCT_METRO_PORT:=8081}\"\necho \"export RCT_METRO_PORT=${RCT_METRO_PORT}\" > \"${SRCROOT}/../node_modules/react-native/scripts/.packager.env\"\nif [ -z \"${RCT_NO_LAUNCH_PACKAGER+xxx}\" ] ; then\n if nc -w 5 -z localhost ${RCT_METRO_PORT} ; then\n if ! curl -s \"http://localhost:${RCT_METRO_PORT}/status\" | grep -q \"packager-status:running\" ; then\n echo \"Port ${RCT_METRO_PORT} already in use, packager is either not running or not running correctly\"\n exit 2\n fi\n else\n open \"$SRCROOT/../node_modules/react-native/scripts/launchPackager.command\" || echo \"Can't start packager automatically\"\n fi\nfi\n"; 362 | showEnvVarsInLog = 0; 363 | }; 364 | /* End PBXShellScriptBuildPhase section */ 365 | 366 | /* Begin PBXSourcesBuildPhase section */ 367 | 00E356EA1AD99517003FC87E /* Sources */ = { 368 | isa = PBXSourcesBuildPhase; 369 | buildActionMask = 2147483647; 370 | files = ( 371 | 00E356F31AD99517003FC87E /* rn_exampleTests.m in Sources */, 372 | ); 373 | runOnlyForDeploymentPostprocessing = 0; 374 | }; 375 | 13B07F871A680F5B00A75B9A /* Sources */ = { 376 | isa = PBXSourcesBuildPhase; 377 | buildActionMask = 2147483647; 378 | files = ( 379 | 13B07FBC1A68108700A75B9A /* AppDelegate.mm in Sources */, 380 | 13B07FC11A68108700A75B9A /* main.m in Sources */, 381 | ); 382 | runOnlyForDeploymentPostprocessing = 0; 383 | }; 384 | /* End PBXSourcesBuildPhase section */ 385 | 386 | /* Begin PBXTargetDependency section */ 387 | 00E356F51AD99517003FC87E /* PBXTargetDependency */ = { 388 | isa = PBXTargetDependency; 389 | target = 13B07F861A680F5B00A75B9A /* rn_example */; 390 | targetProxy = 00E356F41AD99517003FC87E /* PBXContainerItemProxy */; 391 | }; 392 | /* End PBXTargetDependency section */ 393 | 394 | /* Begin XCBuildConfiguration section */ 395 | 00E356F61AD99517003FC87E /* Debug */ = { 396 | isa = XCBuildConfiguration; 397 | baseConfigurationReference = 5B7EB9410499542E8C5724F5 /* Pods-rn_example-rn_exampleTests.debug.xcconfig */; 398 | buildSettings = { 399 | BUNDLE_LOADER = "$(TEST_HOST)"; 400 | GCC_PREPROCESSOR_DEFINITIONS = ( 401 | "DEBUG=1", 402 | "$(inherited)", 403 | ); 404 | INFOPLIST_FILE = rn_exampleTests/Info.plist; 405 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 406 | LD_RUNPATH_SEARCH_PATHS = ( 407 | "$(inherited)", 408 | "@executable_path/Frameworks", 409 | "@loader_path/Frameworks", 410 | ); 411 | OTHER_LDFLAGS = ( 412 | "-ObjC", 413 | "-lc++", 414 | "$(inherited)", 415 | ); 416 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 417 | PRODUCT_NAME = "$(TARGET_NAME)"; 418 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rn_example.app/rn_example"; 419 | }; 420 | name = Debug; 421 | }; 422 | 00E356F71AD99517003FC87E /* Release */ = { 423 | isa = XCBuildConfiguration; 424 | baseConfigurationReference = 89C6BE57DB24E9ADA2F236DE /* Pods-rn_example-rn_exampleTests.release.xcconfig */; 425 | buildSettings = { 426 | BUNDLE_LOADER = "$(TEST_HOST)"; 427 | COPY_PHASE_STRIP = NO; 428 | INFOPLIST_FILE = rn_exampleTests/Info.plist; 429 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 430 | LD_RUNPATH_SEARCH_PATHS = ( 431 | "$(inherited)", 432 | "@executable_path/Frameworks", 433 | "@loader_path/Frameworks", 434 | ); 435 | OTHER_LDFLAGS = ( 436 | "-ObjC", 437 | "-lc++", 438 | "$(inherited)", 439 | ); 440 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 441 | PRODUCT_NAME = "$(TARGET_NAME)"; 442 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/rn_example.app/rn_example"; 443 | }; 444 | name = Release; 445 | }; 446 | 13B07F941A680F5B00A75B9A /* Debug */ = { 447 | isa = XCBuildConfiguration; 448 | baseConfigurationReference = 3B4392A12AC88292D35C810B /* Pods-rn_example.debug.xcconfig */; 449 | buildSettings = { 450 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 451 | CLANG_ENABLE_MODULES = YES; 452 | CURRENT_PROJECT_VERSION = 1; 453 | ENABLE_BITCODE = NO; 454 | INFOPLIST_FILE = rn_example/Info.plist; 455 | LD_RUNPATH_SEARCH_PATHS = ( 456 | "$(inherited)", 457 | "@executable_path/Frameworks", 458 | ); 459 | OTHER_LDFLAGS = ( 460 | "$(inherited)", 461 | "-ObjC", 462 | "-lc++", 463 | ); 464 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 465 | PRODUCT_NAME = rn_example; 466 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 467 | SWIFT_VERSION = 5.0; 468 | VERSIONING_SYSTEM = "apple-generic"; 469 | }; 470 | name = Debug; 471 | }; 472 | 13B07F951A680F5B00A75B9A /* Release */ = { 473 | isa = XCBuildConfiguration; 474 | baseConfigurationReference = 5709B34CF0A7D63546082F79 /* Pods-rn_example.release.xcconfig */; 475 | buildSettings = { 476 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 477 | CLANG_ENABLE_MODULES = YES; 478 | CURRENT_PROJECT_VERSION = 1; 479 | INFOPLIST_FILE = rn_example/Info.plist; 480 | LD_RUNPATH_SEARCH_PATHS = ( 481 | "$(inherited)", 482 | "@executable_path/Frameworks", 483 | ); 484 | OTHER_LDFLAGS = ( 485 | "$(inherited)", 486 | "-ObjC", 487 | "-lc++", 488 | ); 489 | PRODUCT_BUNDLE_IDENTIFIER = "org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)"; 490 | PRODUCT_NAME = rn_example; 491 | SWIFT_VERSION = 5.0; 492 | VERSIONING_SYSTEM = "apple-generic"; 493 | }; 494 | name = Release; 495 | }; 496 | 83CBBA201A601CBA00E9B192 /* Debug */ = { 497 | isa = XCBuildConfiguration; 498 | buildSettings = { 499 | ALWAYS_SEARCH_USER_PATHS = NO; 500 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 501 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 502 | CLANG_CXX_LIBRARY = "libc++"; 503 | CLANG_ENABLE_MODULES = YES; 504 | CLANG_ENABLE_OBJC_ARC = YES; 505 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 506 | CLANG_WARN_BOOL_CONVERSION = YES; 507 | CLANG_WARN_COMMA = YES; 508 | CLANG_WARN_CONSTANT_CONVERSION = YES; 509 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 510 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 511 | CLANG_WARN_EMPTY_BODY = YES; 512 | CLANG_WARN_ENUM_CONVERSION = YES; 513 | CLANG_WARN_INFINITE_RECURSION = YES; 514 | CLANG_WARN_INT_CONVERSION = YES; 515 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 516 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 517 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 518 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 519 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 520 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 521 | CLANG_WARN_STRICT_PROTOTYPES = YES; 522 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 523 | CLANG_WARN_UNREACHABLE_CODE = YES; 524 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 525 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 526 | COPY_PHASE_STRIP = NO; 527 | ENABLE_STRICT_OBJC_MSGSEND = YES; 528 | ENABLE_TESTABILITY = YES; 529 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 530 | GCC_C_LANGUAGE_STANDARD = gnu99; 531 | GCC_DYNAMIC_NO_PIC = NO; 532 | GCC_NO_COMMON_BLOCKS = YES; 533 | GCC_OPTIMIZATION_LEVEL = 0; 534 | GCC_PREPROCESSOR_DEFINITIONS = ( 535 | "DEBUG=1", 536 | "$(inherited)", 537 | ); 538 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 539 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 540 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 541 | GCC_WARN_UNDECLARED_SELECTOR = YES; 542 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 543 | GCC_WARN_UNUSED_FUNCTION = YES; 544 | GCC_WARN_UNUSED_VARIABLE = YES; 545 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 546 | LD_RUNPATH_SEARCH_PATHS = ( 547 | /usr/lib/swift, 548 | "$(inherited)", 549 | ); 550 | LIBRARY_SEARCH_PATHS = ( 551 | "\"$(SDKROOT)/usr/lib/swift\"", 552 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 553 | "\"$(inherited)\"", 554 | ); 555 | MTL_ENABLE_DEBUG_INFO = YES; 556 | ONLY_ACTIVE_ARCH = YES; 557 | OTHER_CPLUSPLUSFLAGS = ( 558 | "$(OTHER_CFLAGS)", 559 | "-DFOLLY_NO_CONFIG", 560 | "-DFOLLY_MOBILE=1", 561 | "-DFOLLY_USE_LIBCPP=1", 562 | ); 563 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 564 | SDKROOT = iphoneos; 565 | }; 566 | name = Debug; 567 | }; 568 | 83CBBA211A601CBA00E9B192 /* Release */ = { 569 | isa = XCBuildConfiguration; 570 | buildSettings = { 571 | ALWAYS_SEARCH_USER_PATHS = NO; 572 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; 573 | CLANG_CXX_LANGUAGE_STANDARD = "c++17"; 574 | CLANG_CXX_LIBRARY = "libc++"; 575 | CLANG_ENABLE_MODULES = YES; 576 | CLANG_ENABLE_OBJC_ARC = YES; 577 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 578 | CLANG_WARN_BOOL_CONVERSION = YES; 579 | CLANG_WARN_COMMA = YES; 580 | CLANG_WARN_CONSTANT_CONVERSION = YES; 581 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 582 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 583 | CLANG_WARN_EMPTY_BODY = YES; 584 | CLANG_WARN_ENUM_CONVERSION = YES; 585 | CLANG_WARN_INFINITE_RECURSION = YES; 586 | CLANG_WARN_INT_CONVERSION = YES; 587 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 588 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 589 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 590 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 591 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; 592 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 593 | CLANG_WARN_STRICT_PROTOTYPES = YES; 594 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 595 | CLANG_WARN_UNREACHABLE_CODE = YES; 596 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 597 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 598 | COPY_PHASE_STRIP = YES; 599 | ENABLE_NS_ASSERTIONS = NO; 600 | ENABLE_STRICT_OBJC_MSGSEND = YES; 601 | "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = ""; 602 | GCC_C_LANGUAGE_STANDARD = gnu99; 603 | GCC_NO_COMMON_BLOCKS = YES; 604 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 605 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 606 | GCC_WARN_UNDECLARED_SELECTOR = YES; 607 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 608 | GCC_WARN_UNUSED_FUNCTION = YES; 609 | GCC_WARN_UNUSED_VARIABLE = YES; 610 | IPHONEOS_DEPLOYMENT_TARGET = 12.4; 611 | LD_RUNPATH_SEARCH_PATHS = ( 612 | /usr/lib/swift, 613 | "$(inherited)", 614 | ); 615 | LIBRARY_SEARCH_PATHS = ( 616 | "\"$(SDKROOT)/usr/lib/swift\"", 617 | "\"$(TOOLCHAIN_DIR)/usr/lib/swift/$(PLATFORM_NAME)\"", 618 | "\"$(inherited)\"", 619 | ); 620 | MTL_ENABLE_DEBUG_INFO = NO; 621 | OTHER_CPLUSPLUSFLAGS = ( 622 | "$(OTHER_CFLAGS)", 623 | "-DFOLLY_NO_CONFIG", 624 | "-DFOLLY_MOBILE=1", 625 | "-DFOLLY_USE_LIBCPP=1", 626 | ); 627 | REACT_NATIVE_PATH = "${PODS_ROOT}/../../node_modules/react-native"; 628 | SDKROOT = iphoneos; 629 | VALIDATE_PRODUCT = YES; 630 | }; 631 | name = Release; 632 | }; 633 | /* End XCBuildConfiguration section */ 634 | 635 | /* Begin XCConfigurationList section */ 636 | 00E357021AD99517003FC87E /* Build configuration list for PBXNativeTarget "rn_exampleTests" */ = { 637 | isa = XCConfigurationList; 638 | buildConfigurations = ( 639 | 00E356F61AD99517003FC87E /* Debug */, 640 | 00E356F71AD99517003FC87E /* Release */, 641 | ); 642 | defaultConfigurationIsVisible = 0; 643 | defaultConfigurationName = Release; 644 | }; 645 | 13B07F931A680F5B00A75B9A /* Build configuration list for PBXNativeTarget "rn_example" */ = { 646 | isa = XCConfigurationList; 647 | buildConfigurations = ( 648 | 13B07F941A680F5B00A75B9A /* Debug */, 649 | 13B07F951A680F5B00A75B9A /* Release */, 650 | ); 651 | defaultConfigurationIsVisible = 0; 652 | defaultConfigurationName = Release; 653 | }; 654 | 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "rn_example" */ = { 655 | isa = XCConfigurationList; 656 | buildConfigurations = ( 657 | 83CBBA201A601CBA00E9B192 /* Debug */, 658 | 83CBBA211A601CBA00E9B192 /* Release */, 659 | ); 660 | defaultConfigurationIsVisible = 0; 661 | defaultConfigurationName = Release; 662 | }; 663 | /* End XCConfigurationList section */ 664 | }; 665 | rootObject = 83CBB9F71A601CBA00E9B192 /* Project object */; 666 | } 667 | -------------------------------------------------------------------------------- /example/ios/rn_example.xcodeproj/xcshareddata/xcschemes/rn_example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 53 | 55 | 61 | 62 | 63 | 64 | 70 | 72 | 78 | 79 | 80 | 81 | 83 | 84 | 87 | 88 | 89 | -------------------------------------------------------------------------------- /example/ios/rn_example.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/rn_example/AppDelegate.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface AppDelegate : UIResponder 5 | 6 | @property (nonatomic, strong) UIWindow *window; 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /example/ios/rn_example/AppDelegate.mm: -------------------------------------------------------------------------------- 1 | #import "AppDelegate.h" 2 | 3 | #import 4 | #import 5 | #import 6 | 7 | #import 8 | 9 | #if RCT_NEW_ARCH_ENABLED 10 | #import 11 | #import 12 | #import 13 | #import 14 | #import 15 | #import 16 | 17 | #import 18 | 19 | static NSString *const kRNConcurrentRoot = @"concurrentRoot"; 20 | 21 | @interface AppDelegate () { 22 | RCTTurboModuleManager *_turboModuleManager; 23 | RCTSurfacePresenterBridgeAdapter *_bridgeAdapter; 24 | std::shared_ptr _reactNativeConfig; 25 | facebook::react::ContextContainer::Shared _contextContainer; 26 | } 27 | @end 28 | #endif 29 | 30 | @implementation AppDelegate 31 | 32 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 33 | { 34 | RCTAppSetupPrepareApp(application); 35 | 36 | RCTBridge *bridge = [[RCTBridge alloc] initWithDelegate:self launchOptions:launchOptions]; 37 | 38 | #if RCT_NEW_ARCH_ENABLED 39 | _contextContainer = std::make_shared(); 40 | _reactNativeConfig = std::make_shared(); 41 | _contextContainer->insert("ReactNativeConfig", _reactNativeConfig); 42 | _bridgeAdapter = [[RCTSurfacePresenterBridgeAdapter alloc] initWithBridge:bridge contextContainer:_contextContainer]; 43 | bridge.surfacePresenter = _bridgeAdapter.surfacePresenter; 44 | #endif 45 | 46 | NSDictionary *initProps = [self prepareInitialProps]; 47 | UIView *rootView = RCTAppSetupDefaultRootView(bridge, @"rn_example", initProps); 48 | 49 | if (@available(iOS 13.0, *)) { 50 | rootView.backgroundColor = [UIColor systemBackgroundColor]; 51 | } else { 52 | rootView.backgroundColor = [UIColor whiteColor]; 53 | } 54 | 55 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 56 | UIViewController *rootViewController = [UIViewController new]; 57 | rootViewController.view = rootView; 58 | self.window.rootViewController = rootViewController; 59 | [self.window makeKeyAndVisible]; 60 | return YES; 61 | } 62 | 63 | /// This method controls whether the `concurrentRoot`feature of React18 is turned on or off. 64 | /// 65 | /// @see: https://reactjs.org/blog/2022/03/29/react-v18.html 66 | /// @note: This requires to be rendering on Fabric (i.e. on the New Architecture). 67 | /// @return: `true` if the `concurrentRoot` feture is enabled. Otherwise, it returns `false`. 68 | - (BOOL)concurrentRootEnabled 69 | { 70 | // Switch this bool to turn on and off the concurrent root 71 | return true; 72 | } 73 | 74 | - (NSDictionary *)prepareInitialProps 75 | { 76 | NSMutableDictionary *initProps = [NSMutableDictionary new]; 77 | 78 | #ifdef RCT_NEW_ARCH_ENABLED 79 | initProps[kRNConcurrentRoot] = @([self concurrentRootEnabled]); 80 | #endif 81 | 82 | return initProps; 83 | } 84 | 85 | - (NSURL *)sourceURLForBridge:(RCTBridge *)bridge 86 | { 87 | #if DEBUG 88 | return [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index"]; 89 | #else 90 | return [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"]; 91 | #endif 92 | } 93 | 94 | #if RCT_NEW_ARCH_ENABLED 95 | 96 | #pragma mark - RCTCxxBridgeDelegate 97 | 98 | - (std::unique_ptr)jsExecutorFactoryForBridge:(RCTBridge *)bridge 99 | { 100 | _turboModuleManager = [[RCTTurboModuleManager alloc] initWithBridge:bridge 101 | delegate:self 102 | jsInvoker:bridge.jsCallInvoker]; 103 | return RCTAppSetupDefaultJsExecutorFactory(bridge, _turboModuleManager); 104 | } 105 | 106 | #pragma mark RCTTurboModuleManagerDelegate 107 | 108 | - (Class)getModuleClassFromName:(const char *)name 109 | { 110 | return RCTCoreModulesClassProvider(name); 111 | } 112 | 113 | - (std::shared_ptr)getTurboModule:(const std::string &)name 114 | jsInvoker:(std::shared_ptr)jsInvoker 115 | { 116 | return nullptr; 117 | } 118 | 119 | - (std::shared_ptr)getTurboModule:(const std::string &)name 120 | initParams: 121 | (const facebook::react::ObjCTurboModule::InitParams &)params 122 | { 123 | return nullptr; 124 | } 125 | 126 | - (id)getModuleInstanceFromClass:(Class)moduleClass 127 | { 128 | return RCTAppSetupDefaultModuleFromClass(moduleClass); 129 | } 130 | 131 | #endif 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /example/ios/rn_example/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "scale" : "2x", 6 | "size" : "20x20" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "scale" : "3x", 11 | "size" : "20x20" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "scale" : "2x", 16 | "size" : "29x29" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "scale" : "3x", 21 | "size" : "29x29" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "scale" : "2x", 26 | "size" : "40x40" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "scale" : "3x", 31 | "size" : "40x40" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "scale" : "2x", 36 | "size" : "60x60" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "scale" : "3x", 41 | "size" : "60x60" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "scale" : "1x", 46 | "size" : "1024x1024" 47 | } 48 | ], 49 | "info" : { 50 | "author" : "xcode", 51 | "version" : 1 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /example/ios/rn_example/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /example/ios/rn_example/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | rn_example 9 | CFBundleExecutable 10 | $(EXECUTABLE_NAME) 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | LSRequiresIPhoneOS 26 | 27 | NSAppTransportSecurity 28 | 29 | NSExceptionDomains 30 | 31 | localhost 32 | 33 | NSExceptionAllowsInsecureHTTPLoads 34 | 35 | 36 | 37 | 38 | NSLocationWhenInUseUsageDescription 39 | 40 | UILaunchStoryboardName 41 | LaunchScreen 42 | UIRequiredDeviceCapabilities 43 | 44 | armv7 45 | 46 | UISupportedInterfaceOrientations 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationLandscapeLeft 50 | UIInterfaceOrientationLandscapeRight 51 | 52 | UIViewControllerBasedStatusBarAppearance 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /example/ios/rn_example/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 24 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /example/ios/rn_example/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | #import "AppDelegate.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | @autoreleasepool { 8 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /example/ios/rn_exampleTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /example/ios/rn_exampleTests/rn_exampleTests.m: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | #import 5 | #import 6 | 7 | #define TIMEOUT_SECONDS 600 8 | #define TEXT_TO_LOOK_FOR @"Welcome to React" 9 | 10 | @interface rn_exampleTests : XCTestCase 11 | 12 | @end 13 | 14 | @implementation rn_exampleTests 15 | 16 | - (BOOL)findSubviewInView:(UIView *)view matching:(BOOL (^)(UIView *view))test 17 | { 18 | if (test(view)) { 19 | return YES; 20 | } 21 | for (UIView *subview in [view subviews]) { 22 | if ([self findSubviewInView:subview matching:test]) { 23 | return YES; 24 | } 25 | } 26 | return NO; 27 | } 28 | 29 | - (void)testRendersWelcomeScreen 30 | { 31 | UIViewController *vc = [[[RCTSharedApplication() delegate] window] rootViewController]; 32 | NSDate *date = [NSDate dateWithTimeIntervalSinceNow:TIMEOUT_SECONDS]; 33 | BOOL foundElement = NO; 34 | 35 | __block NSString *redboxError = nil; 36 | #ifdef DEBUG 37 | RCTSetLogFunction( 38 | ^(RCTLogLevel level, RCTLogSource source, NSString *fileName, NSNumber *lineNumber, NSString *message) { 39 | if (level >= RCTLogLevelError) { 40 | redboxError = message; 41 | } 42 | }); 43 | #endif 44 | 45 | while ([date timeIntervalSinceNow] > 0 && !foundElement && !redboxError) { 46 | [[NSRunLoop mainRunLoop] runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 47 | [[NSRunLoop mainRunLoop] runMode:NSRunLoopCommonModes beforeDate:[NSDate dateWithTimeIntervalSinceNow:0.1]]; 48 | 49 | foundElement = [self findSubviewInView:vc.view 50 | matching:^BOOL(UIView *view) { 51 | if ([view.accessibilityLabel isEqualToString:TEXT_TO_LOOK_FOR]) { 52 | return YES; 53 | } 54 | return NO; 55 | }]; 56 | } 57 | 58 | #ifdef DEBUG 59 | RCTSetLogFunction(RCTDefaultLogFunction); 60 | #endif 61 | 62 | XCTAssertNil(redboxError, @"RedBox error: %@", redboxError); 63 | XCTAssertTrue(foundElement, @"Couldn't find element with text '%@' in %d seconds", TEXT_TO_LOOK_FOR, TIMEOUT_SECONDS); 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /example/metro.config.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Metro configuration for React Native 3 | * https://github.com/facebook/react-native 4 | * 5 | * @format 6 | */ 7 | const path = require('path'); 8 | const rootPackage = require('../package.json'); 9 | const blacklist = require('metro-config/src/defaults/exclusionList'); 10 | const rootModules = Object.keys({ 11 | ...rootPackage.peerDependencies, 12 | }); 13 | const moduleRoot = path.resolve(__dirname, '..'); 14 | /** 15 | * Only load one version for peerDependencies and alias them to the versions in example's node_modules" 16 | */ 17 | module.exports = { 18 | watchFolders: [moduleRoot], 19 | resolver: { 20 | blacklistRE: blacklist([ 21 | ...rootModules.map( 22 | m => 23 | new RegExp( 24 | `^${escape(path.join(moduleRoot, 'node_modules', m))}\\/.*$` 25 | ) 26 | ), 27 | /^((?!example).)+[\/\\]node_modules[/\\]react[/\\].*/, 28 | /^((?!example).)+[\/\\]node_modules[/\\]react-native[/\\].*/, 29 | ]), 30 | extraNodeModules: { 31 | ...rootModules.reduce((acc, name) => { 32 | acc[name] = path.join(__dirname, 'node_modules', name); 33 | return acc; 34 | }, {}), 35 | }, 36 | }, 37 | transformer: { 38 | getTransformOptions: async () => ({ 39 | transform: { 40 | experimentalImportSupport: false, 41 | inlineRequires: true, 42 | }, 43 | }), 44 | }, 45 | }; 46 | -------------------------------------------------------------------------------- /example/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "rn_example", 3 | "version": "0.0.1", 4 | "private": true, 5 | "scripts": { 6 | "android": "react-native run-android", 7 | "ios": "react-native run-ios", 8 | "start": "react-native start", 9 | "test": "jest", 10 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx" 11 | }, 12 | "dependencies": { 13 | "react": "18.1.0", 14 | "react-native": "0.70.0", 15 | "react-native-gesture-handler": "^2.9.0", 16 | "react-native-reanimated": "^3.0.0" 17 | }, 18 | "devDependencies": { 19 | "@babel/core": "^7.12.9", 20 | "@babel/runtime": "^7.12.5", 21 | "@react-native-community/eslint-config": "^2.0.0", 22 | "@tsconfig/react-native": "^2.0.2", 23 | "@types/jest": "^26.0.23", 24 | "@types/react-native": "^0.69.6", 25 | "@types/react-test-renderer": "^18.0.0", 26 | "@typescript-eslint/eslint-plugin": "^5.36.2", 27 | "@typescript-eslint/parser": "^5.36.2", 28 | "babel-jest": "^26.6.3", 29 | "eslint": "^7.32.0", 30 | "jest": "^26.6.3", 31 | "metro-react-native-babel-preset": "^0.72.1", 32 | "react-test-renderer": "18.1.0", 33 | "typescript": "^4.8.2" 34 | }, 35 | "resolutions": { 36 | "@types/react": "*" 37 | }, 38 | "jest": { 39 | "preset": "react-native", 40 | "moduleFileExtensions": [ 41 | "ts", 42 | "tsx", 43 | "js", 44 | "jsx", 45 | "json", 46 | "node" 47 | ] 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /example/src/App.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { SafeAreaView, ScrollView, Text, View } from 'react-native'; 3 | import { ImagePreview } from 'react-native-images-preview'; 4 | import { images } from './assets'; 5 | import { CustomHeader, ModalHeader } from './components'; 6 | import { imageData, Strings } from './constants'; 7 | import { applicationStyle } from './theme'; 8 | 9 | const { 10 | screen, 11 | scrollViewStyle, 12 | textStyle, 13 | imageStyle, 14 | horizontalView, 15 | customImageStyle, 16 | } = applicationStyle; 17 | 18 | const App = () => { 19 | return ( 20 | 21 | 22 | 23 | {Strings.dummyText} 24 | 25 | {Strings.dummyText} 26 | 32 | {Strings.dummyText} 33 | 34 | ( 36 | 37 | )} 38 | imageSource={{ 39 | uri: imageData.image2, 40 | }} 41 | imageStyle={[imageStyle, customImageStyle]} 42 | /> 43 | 49 | 50 | 51 | 52 | ); 53 | }; 54 | 55 | export default App; 56 | -------------------------------------------------------------------------------- /example/src/assets/images/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/src/assets/images/close.png -------------------------------------------------------------------------------- /example/src/assets/images/forest.jpeg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/example/src/assets/images/forest.jpeg -------------------------------------------------------------------------------- /example/src/assets/images/index.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | forest: require('./forest.jpeg'), 3 | close: require('./close.png'), 4 | }; 5 | -------------------------------------------------------------------------------- /example/src/assets/index.ts: -------------------------------------------------------------------------------- 1 | export { default as images } from './images'; 2 | -------------------------------------------------------------------------------- /example/src/components/CustomHeader.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, View } from 'react-native'; 3 | import { CustomHeaderStyle as styles } from './styles'; 4 | import type { CustomHeaderType } from './Types'; 5 | 6 | const CustomHeader = ({ title }: CustomHeaderType) => { 7 | return ( 8 | 9 | {title} 10 | 11 | ); 12 | }; 13 | 14 | export default CustomHeader; 15 | -------------------------------------------------------------------------------- /example/src/components/ModalHeader.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { 3 | Image, 4 | TouchableOpacity, 5 | type TouchableOpacityProps, 6 | } from 'react-native'; 7 | import { images } from '../assets'; 8 | import { ModalHeaderStyle as styles } from './styles'; 9 | 10 | const ModalHeader = (props: TouchableOpacityProps) => { 11 | return ( 12 | 13 | 14 | 15 | ); 16 | }; 17 | 18 | export default ModalHeader; 19 | -------------------------------------------------------------------------------- /example/src/components/Types.ts: -------------------------------------------------------------------------------- 1 | type CustomHeaderType = { 2 | title: string; 3 | }; 4 | 5 | export type { CustomHeaderType }; 6 | -------------------------------------------------------------------------------- /example/src/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as CustomHeader } from './CustomHeader'; 2 | export { default as ModalHeader } from './ModalHeader'; 3 | -------------------------------------------------------------------------------- /example/src/components/styles/CustomHeaderStyle.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import { Colors, Metrics } from '../../theme'; 3 | 4 | const { verticalScale, moderateScale, horizontalScale } = Metrics; 5 | 6 | const styles = StyleSheet.create({ 7 | container: { 8 | flexDirection: 'row', 9 | height: verticalScale(60), 10 | backgroundColor: Colors.blue700, 11 | justifyContent: 'space-between', 12 | alignItems: 'center', 13 | paddingHorizontal: horizontalScale(5), 14 | }, 15 | textStyle: { 16 | color: Colors.white, 17 | fontSize: moderateScale(18), 18 | fontWeight: '600', 19 | textAlign: 'center', 20 | }, 21 | }); 22 | 23 | export default styles; 24 | -------------------------------------------------------------------------------- /example/src/components/styles/ModalHeaderStyle.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import { Colors, Metrics } from '../../theme'; 3 | 4 | const { horizontalScale, moderateScale } = Metrics; 5 | 6 | const styles = StyleSheet.create({ 7 | closeIcon: { 8 | height: moderateScale(22), 9 | width: moderateScale(22), 10 | marginLeft: horizontalScale(10), 11 | tintColor: Colors.white, 12 | }, 13 | }); 14 | 15 | export default styles; 16 | -------------------------------------------------------------------------------- /example/src/components/styles/index.ts: -------------------------------------------------------------------------------- 1 | export { default as CustomHeaderStyle } from './CustomHeaderStyle'; 2 | export { default as ModalHeaderStyle } from './ModalHeaderStyle'; 3 | -------------------------------------------------------------------------------- /example/src/constants/StaticData.ts: -------------------------------------------------------------------------------- 1 | export const imageData = { 2 | image1: 3 | 'https://images.unsplash.com/photo-1490109875367-0dbd3c96fa1c?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1740&q=80', 4 | image2: 5 | 'https://images.unsplash.com/photo-1591892234230-dc80bfe2ee31?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=726&q=80', 6 | image3: 7 | 'https://images.unsplash.com/photo-1523251343397-9225e4cb6319?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=774&q=80', 8 | }; 9 | -------------------------------------------------------------------------------- /example/src/constants/Strings.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | dummyText: 3 | "Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.", 4 | home: 'Home', 5 | }; 6 | -------------------------------------------------------------------------------- /example/src/constants/index.ts: -------------------------------------------------------------------------------- 1 | export { imageData } from './StaticData'; 2 | export { default as Strings } from './Strings'; 3 | -------------------------------------------------------------------------------- /example/src/theme/ApplicationStyle.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import Colors from './Colors'; 3 | import Metrics from './Metrics'; 4 | 5 | const { verticalScale, moderateScale, horizontalScale } = Metrics; 6 | 7 | const applicationStyle = StyleSheet.create({ 8 | screen: { 9 | flex: 1, 10 | }, 11 | imageStyle: { 12 | height: verticalScale(200), 13 | width: '100%', 14 | }, 15 | textStyle: { 16 | color: Colors.black, 17 | fontSize: moderateScale(18), 18 | marginVertical: verticalScale(10), 19 | textAlign: 'justify', 20 | }, 21 | scrollViewStyle: { 22 | marginHorizontal: horizontalScale(10), 23 | backgroundColor: Colors.white, 24 | }, 25 | horizontalView: { 26 | flexDirection: 'row', 27 | justifyContent: 'space-around', 28 | }, 29 | customImageStyle: { 30 | width: horizontalScale(170), 31 | }, 32 | }); 33 | 34 | export default applicationStyle; 35 | -------------------------------------------------------------------------------- /example/src/theme/Colors.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | white: '#FFFFFF', 3 | black: '#000000', 4 | transparent: 'transparent', 5 | blue700: '#0288D1', 6 | }; 7 | -------------------------------------------------------------------------------- /example/src/theme/Metrics.ts: -------------------------------------------------------------------------------- 1 | import { Dimensions, Platform } from 'react-native'; 2 | 3 | let { width, height } = Dimensions.get('window'); 4 | if (width > height) { 5 | [width, height] = [height, width]; 6 | } 7 | //Guideline sizes are based on standard ~5" screen mobile device 8 | 9 | const guidelineBaseWidth = 375; 10 | 11 | const guidelineBaseHeight = 812; 12 | 13 | const horizontalScale = (size: number) => (width / guidelineBaseWidth) * size; 14 | 15 | const verticalScale = (size: number) => (height / guidelineBaseHeight) * size; 16 | 17 | const moderateScale = (size: number, factor = 0.5) => 18 | size + (horizontalScale(size) - size) * factor; 19 | 20 | const globalMetrics = { 21 | isAndroid: Platform.OS !== 'ios', 22 | }; 23 | 24 | export default { globalMetrics, horizontalScale, verticalScale, moderateScale }; 25 | -------------------------------------------------------------------------------- /example/src/theme/index.ts: -------------------------------------------------------------------------------- 1 | export { default as applicationStyle } from './ApplicationStyle'; 2 | export { default as Colors } from './Colors'; 3 | export { default as Metrics } from './Metrics'; 4 | -------------------------------------------------------------------------------- /example/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "esModuleInterop": true, 5 | "jsx": "react-native", 6 | "lib": ["ESNext"], 7 | "module": "CommonJS", 8 | "noEmit": true, 9 | "paths": { 10 | "react-native-images-preview": ["../src"] 11 | }, 12 | "declaration": true, 13 | "allowUnreachableCode": false, 14 | "allowUnusedLabels": false, 15 | "importsNotUsedAsValues": "error", 16 | "forceConsistentCasingInFileNames": true, 17 | "moduleResolution": "Node", 18 | "noFallthroughCasesInSwitch": true, 19 | "noImplicitReturns": true, 20 | "noImplicitUseStrict": false, 21 | "noStrictGenericChecks": false, 22 | "noUnusedLocals": true, 23 | "noUnusedParameters": true, 24 | "resolveJsonModule": true, 25 | "noEmitOnError": true, 26 | "skipLibCheck": true, 27 | "sourceMap": true, 28 | "strict": true, 29 | "target": "ES2018" 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "react-native-images-preview", 3 | "version": "0.0.1", 4 | "description": "A React Native animated custom images preview component.", 5 | "main": "lib/index", 6 | "types": "lib/index.d.ts", 7 | "contributors": [], 8 | "author": "Simform Solutions", 9 | "repository": { 10 | "type": "git", 11 | "url": "https://github.com/SimformSolutionsPvtLtd/react-native-images-preview" 12 | }, 13 | "homepage": "https://github.com/SimformSolutionsPvtLtd/react-native-images-preview#readme", 14 | "keywords": [ 15 | "react", 16 | "react-native", 17 | "typescript", 18 | "rn", 19 | "photo", 20 | "reanimated", 21 | "component", 22 | "react-component", 23 | "iOS", 24 | "android", 25 | "gallery", 26 | "pinch", 27 | "pinch-to-zoom", 28 | "mobile", 29 | "image-zoom", 30 | "image", 31 | "photo preview", 32 | "image preview" 33 | ], 34 | "license": "MIT", 35 | "files": [ 36 | "/lib" 37 | ], 38 | "scripts": { 39 | "prepare": "husky install && yarn build", 40 | "clean": "rm -rf node_modules", 41 | "build": "rm -rf lib && tsc -p . && cp -R ./src/assets ./lib/ ", 42 | "lint": "eslint . --ext .js,.jsx,.ts,.tsx", 43 | "lint:fix": "eslint 'src/**/*.{js,jsx,ts,tsx}' -c .eslintrc --fix ", 44 | "build:local": "yarn build && yarn pack", 45 | "test": "jest", 46 | "example": "yarn --cwd example" 47 | }, 48 | "peerDependencies": { 49 | "react": "*", 50 | "react-native": "*", 51 | "react-native-reanimated": "^3.0.0", 52 | "react-native-gesture-handler": "^2.9.0" 53 | }, 54 | "devDependencies": { 55 | "@babel/core": "^7.12.9", 56 | "@babel/runtime": "^7.12.5", 57 | "@commitlint/cli": "^16.1.0", 58 | "@commitlint/config-conventional": "^16.0.0", 59 | "@react-native-community/eslint-config": "^3.0.1", 60 | "@testing-library/react-native": "^9.0.0", 61 | "@tsconfig/react-native": "^2.0.2", 62 | "@types/jest": "^27.4.0", 63 | "@types/react-native": "^0.69.5", 64 | "@types/react-test-renderer": "^18.0.0", 65 | "@typescript-eslint/eslint-plugin": "^5.29.0", 66 | "@typescript-eslint/parser": "^5.29.0", 67 | "babel-jest": "^27.4.6", 68 | "eslint": "^7.32.0", 69 | "eslint-plugin-simple-import-sort": "^7.0.0", 70 | "husky": "^8.0.1", 71 | "jest": "^27.4.7", 72 | "lint-staged": "^11.1.2", 73 | "metro-react-native-babel-preset": "^0.70.3", 74 | "prettier": "^2.7.1", 75 | "react": "18.0.0", 76 | "react-native": "0.69.5", 77 | "react-test-renderer": "18.0.0", 78 | "typescript": "4.7.4", 79 | "react-native-reanimated": "^3.0.0", 80 | "react-native-gesture-handler": "^2.9.0" 81 | }, 82 | "husky": { 83 | "hooks": { 84 | "pre-commit": "lint-staged", 85 | "pre-push": "yarn build && yarn test" 86 | } 87 | }, 88 | "lint-staged": { 89 | "src/**/*.{js,ts,tsx}": [ 90 | "eslint" 91 | ] 92 | }, 93 | "resolutions": { 94 | "@types/react": "*" 95 | }, 96 | "jest": { 97 | "preset": "react-native", 98 | "moduleFileExtensions": [ 99 | "ts", 100 | "tsx", 101 | "js", 102 | "jsx", 103 | "json", 104 | "node" 105 | ], 106 | "setupFilesAfterEnv": [], 107 | "modulePathIgnorePatterns": [] 108 | }, 109 | "eslintIgnore": [ 110 | "node_modules/", 111 | "lib/" 112 | ], 113 | "commitlint": { 114 | "extends": [ 115 | "@commitlint/config-conventional" 116 | ] 117 | } 118 | } -------------------------------------------------------------------------------- /src/assets/images/errorImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SimformSolutionsPvtLtd/react-native-images-preview/350a3b1354fcb0a719eb12420b0defba801f4bea/src/assets/images/errorImage.png -------------------------------------------------------------------------------- /src/assets/images/index.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | errorImage: require('./errorImage.png'), 3 | }; 4 | -------------------------------------------------------------------------------- /src/assets/index.ts: -------------------------------------------------------------------------------- 1 | export { default as images } from './images'; 2 | -------------------------------------------------------------------------------- /src/components/ImagePreview/ImagePreview.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Image, TouchableOpacity, View } from 'react-native'; 3 | import { images } from '../../assets'; 4 | import { ErrorImage, ImageLoader, ImageModal } from './components'; 5 | import { useImagePreview } from './hooks'; 6 | import styles from './Styles'; 7 | import type { ImagePreviewProps } from './Types'; 8 | 9 | const ImagePreview = ({ 10 | imageSource, 11 | imageStyle, 12 | renderHeader, 13 | imageProps, 14 | pinchZoomEnabled = true, 15 | doubleTapZoomEnabled = true, 16 | swipeDownCloseEnabled = true, 17 | errorImageSource = images.errorImage, 18 | imageLoaderProps, 19 | renderImageLoader, 20 | }: ImagePreviewProps) => { 21 | const { 22 | modalConfig, 23 | onPressImage, 24 | setModalConfig, 25 | imageRef, 26 | loading, 27 | setLoading, 28 | error, 29 | setError, 30 | } = useImagePreview(); 31 | 32 | return ( 33 | <> 34 | {imageSource && ( 35 | <> 36 | {modalConfig.visible ? ( 37 | 48 | ) : ( 49 | 53 | { 58 | setLoading(true); 59 | setError(false); 60 | }} 61 | onLoadEnd={() => { 62 | setLoading(false); 63 | }} 64 | onError={() => { 65 | setLoading(false); 66 | setError(true); 67 | }} 68 | {...imageProps} 69 | /> 70 | {error && } 71 | {loading && ( 72 | 73 | )} 74 | 75 | )} 76 | {modalConfig.visible && } 77 | 78 | )} 79 | 80 | ); 81 | }; 82 | 83 | export default ImagePreview; 84 | -------------------------------------------------------------------------------- /src/components/ImagePreview/Styles.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const styles = StyleSheet.create({ 4 | container: { 5 | justifyContent: 'center', 6 | alignItems: 'center', 7 | }, 8 | imageParent: { 9 | alignItems: 'center', 10 | justifyContent: 'center', 11 | }, 12 | activityIndicatorStyle: { 13 | position: 'absolute', 14 | top: 0, 15 | left: 0, 16 | right: 0, 17 | bottom: 0, 18 | }, 19 | }); 20 | 21 | export default styles; 22 | -------------------------------------------------------------------------------- /src/components/ImagePreview/Types.ts: -------------------------------------------------------------------------------- 1 | import type { Dispatch, SetStateAction } from 'react'; 2 | import type { 3 | ActivityIndicatorProps, 4 | ImageProps, 5 | ImageSourcePropType, 6 | ImageStyle, 7 | StyleProp, 8 | } from 'react-native'; 9 | 10 | export type ModalConfigType = { 11 | x: number; 12 | y: number; 13 | height: number; 14 | width: number; 15 | visible: boolean; 16 | }; 17 | 18 | export type HeaderOpacityAnimationType = { 19 | opacity: number; 20 | }; 21 | 22 | export type ImagePreviewProps = { 23 | imageSource: ImageSourcePropType; 24 | imageStyle: StyleProp; 25 | imageProps?: Omit; 26 | doubleTapZoomEnabled?: boolean; 27 | pinchZoomEnabled?: boolean; 28 | swipeDownCloseEnabled?: boolean; 29 | errorImageSource?: ImageSourcePropType; 30 | renderHeader?: (close: () => void) => React.ReactElement; 31 | imageLoaderProps?: ActivityIndicatorProps; 32 | } & Pick; 33 | 34 | export type ImageModalProps = Omit< 35 | ImagePreviewProps, 36 | 'imageStyle' | 'imageProps' | 'errorImageSource' 37 | > & { 38 | setModalConfig: Dispatch>; 39 | modalConfig: ModalConfigType; 40 | }; 41 | 42 | export type HeaderProps = Pick & { 43 | onPressClose: () => void; 44 | headerOpacityAnimation: HeaderOpacityAnimationType; 45 | }; 46 | 47 | export type ErrorImageProps = Required< 48 | Pick 49 | >; 50 | export type UseImageModalProps = { 51 | modalConfig: ModalConfigType; 52 | setModalConfig: Dispatch>; 53 | pinchZoomEnabled: boolean | undefined; 54 | doubleTapZoomEnabled: boolean | undefined; 55 | swipeDownCloseEnabled: boolean | undefined; 56 | }; 57 | 58 | export type ImageLoaderProps = ActivityIndicatorProps & { 59 | renderImageLoader?: () => React.ReactElement; 60 | }; 61 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/ErrorImage.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Image } from 'react-native'; 3 | import type { ErrorImageProps } from '../Types'; 4 | import { ErrorImageStyle as styles } from './styles'; 5 | 6 | const ErrorImage = ({ imageStyle, errorImageSource }: ErrorImageProps) => ( 7 | 12 | ); 13 | 14 | export default ErrorImage; 15 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/Header.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { Text, TouchableOpacity } from 'react-native'; 3 | import Animated from 'react-native-reanimated'; 4 | import { Strings } from '../../../constants'; 5 | import type { HeaderProps } from '../Types'; 6 | import { HeaderStyle as styles } from './styles'; 7 | 8 | const Header = ({ 9 | renderHeader, 10 | onPressClose, 11 | headerOpacityAnimation, 12 | }: HeaderProps) => { 13 | return ( 14 | 15 | {renderHeader ? ( 16 | renderHeader(onPressClose) 17 | ) : ( 18 | { 21 | onPressClose(); 22 | }}> 23 | {Strings.close} 24 | 25 | )} 26 | 27 | ); 28 | }; 29 | 30 | export default Header; 31 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/ImageLoader.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ActivityIndicator } from 'react-native'; 3 | import type { ImageLoaderProps } from '../Types'; 4 | import { ImageLoaderStyle as styles } from './styles'; 5 | 6 | const ImageLoader = ({ renderImageLoader, ...rest }: ImageLoaderProps) => { 7 | return renderImageLoader ? ( 8 | renderImageLoader() 9 | ) : ( 10 | 11 | ); 12 | }; 13 | 14 | export default ImageLoader; 15 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/ImageModal.tsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import { ActivityIndicator, Modal, SafeAreaView } from 'react-native'; 3 | import { 4 | Gesture, 5 | GestureDetector, 6 | GestureHandlerRootView, 7 | } from 'react-native-gesture-handler'; 8 | import Animated from 'react-native-reanimated'; 9 | import { useImageModal } from '../hooks'; 10 | import type { ImageModalProps } from '../Types'; 11 | import Header from './Header'; 12 | import { ImageModalStyle } from './styles'; 13 | 14 | const ImageModal = ({ 15 | setModalConfig, 16 | modalConfig, 17 | renderHeader, 18 | imageSource, 19 | doubleTapZoomEnabled, 20 | pinchZoomEnabled, 21 | swipeDownCloseEnabled, 22 | }: ImageModalProps) => { 23 | const styles = ImageModalStyle( 24 | modalConfig.x, 25 | modalConfig.y, 26 | modalConfig.height, 27 | modalConfig.width 28 | ); 29 | const { 30 | imageAnimatedStyle, 31 | onPressClose, 32 | modalAnimatedStyle, 33 | animatedImageRef, 34 | animatedImageStyle, 35 | loading, 36 | setLoading, 37 | headerOpacityAnimation, 38 | doubleTapEvent, 39 | panGestureEvent, 40 | pinchGestureEvent, 41 | } = useImageModal({ 42 | modalConfig, 43 | setModalConfig, 44 | pinchZoomEnabled, 45 | doubleTapZoomEnabled, 46 | swipeDownCloseEnabled, 47 | }); 48 | 49 | return ( 50 | 51 | 52 | 57 | 58 | 59 |

62 | {loading && ( 63 | 64 | )} 65 | { 75 | setLoading(true); 76 | }} 77 | onLoadEnd={() => { 78 | setLoading(false); 79 | }} 80 | /> 81 | 82 | 83 | 84 | 85 | 86 | ); 87 | }; 88 | 89 | export default ImageModal; 90 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ErrorImage } from './ErrorImage'; 2 | export { default as ImageLoader } from './ImageLoader'; 3 | export { default as ImageModal } from './ImageModal'; 4 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/styles/ErrorImageStyle.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import { Colors } from '../../../../theme'; 3 | 4 | const styles = StyleSheet.create({ 5 | defaultStyle: { 6 | position: 'absolute', 7 | backgroundColor: Colors.white, 8 | }, 9 | }); 10 | 11 | export default styles; 12 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/styles/HeaderStyle.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | import { Colors, Metrics } from '../../../../theme'; 3 | 4 | const { horizontalScale, verticalScale, moderateScale, width } = Metrics; 5 | 6 | const styles = StyleSheet.create({ 7 | closeButton: { 8 | borderWidth: 2, 9 | alignItems: 'center', 10 | alignSelf: 'flex-end', 11 | justifyContent: 'center', 12 | borderColor: Colors.white, 13 | height: verticalScale(40), 14 | width: horizontalScale(80), 15 | marginTop: verticalScale(5), 16 | marginRight: horizontalScale(5), 17 | borderRadius: moderateScale(20), 18 | backgroundColor: Colors.black, 19 | }, 20 | closeButtonParent: { 21 | width, 22 | zIndex: 1, 23 | }, 24 | closeText: { 25 | fontSize: moderateScale(16), 26 | color: Colors.white, 27 | }, 28 | }); 29 | 30 | export default styles; 31 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/styles/ImageLoaderStyle.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const styles = StyleSheet.create({ 4 | activityIndicatorStyle: { 5 | position: 'absolute', 6 | top: 0, 7 | left: 0, 8 | right: 0, 9 | bottom: 0, 10 | }, 11 | }); 12 | 13 | export default styles; 14 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/styles/ImageModalStyle.ts: -------------------------------------------------------------------------------- 1 | import { StyleSheet } from 'react-native'; 2 | 3 | const styles = (x: number, y: number, height: number, width: number) => 4 | StyleSheet.create({ 5 | modalContainer: { 6 | flex: 1, 7 | }, 8 | gestureContainer: { 9 | flex: 1, 10 | }, 11 | imageStyle: { 12 | position: 'absolute', 13 | top: y, 14 | left: x, 15 | height, 16 | width, 17 | }, 18 | activityIndicatorStyle: { 19 | position: 'absolute', 20 | top: 0, 21 | left: 0, 22 | bottom: 0, 23 | right: 0, 24 | }, 25 | }); 26 | 27 | export default styles; 28 | -------------------------------------------------------------------------------- /src/components/ImagePreview/components/styles/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ErrorImageStyle } from './ErrorImageStyle'; 2 | export { default as HeaderStyle } from './HeaderStyle'; 3 | export { default as ImageLoaderStyle } from './ImageLoaderStyle'; 4 | export { default as ImageModalStyle } from './ImageModalStyle'; 5 | -------------------------------------------------------------------------------- /src/components/ImagePreview/hooks/index.ts: -------------------------------------------------------------------------------- 1 | export { default as useImagePreview } from './useImagePreview'; 2 | export { default as useImageModal } from './useImageModal'; 3 | -------------------------------------------------------------------------------- /src/components/ImagePreview/hooks/useImageModal.ts: -------------------------------------------------------------------------------- 1 | import { useEffect, useState } from 'react'; 2 | import { useWindowDimensions } from 'react-native'; 3 | import { Gesture } from 'react-native-gesture-handler'; 4 | import Animated, { 5 | interpolate, 6 | interpolateColor, 7 | runOnJS, 8 | useAnimatedRef, 9 | useAnimatedStyle, 10 | useSharedValue, 11 | withTiming, 12 | } from 'react-native-reanimated'; 13 | import { StaticValues } from '../../../constants'; 14 | import { Colors } from '../../../theme'; 15 | import type { UseImageModalProps } from '../Types'; 16 | 17 | const useImageModal = ({ 18 | modalConfig, 19 | setModalConfig, 20 | pinchZoomEnabled, 21 | doubleTapZoomEnabled, 22 | swipeDownCloseEnabled, 23 | }: UseImageModalProps) => { 24 | const { height: WINDOW_HEIGHT, width: WINDOW_WIDTH } = useWindowDimensions(); 25 | const animatedImageRef = useAnimatedRef(); 26 | const [loading, setLoading] = useState(false); 27 | 28 | const offset = useSharedValue(0); 29 | const colorOffset = useSharedValue(0); 30 | const scale = useSharedValue(1); 31 | const translateY = useSharedValue(0); 32 | const translateX = useSharedValue(0); 33 | const saveScale = useSharedValue(1); 34 | const oldTranslateX = useSharedValue(modalConfig.x); 35 | const oldTranslateY = useSharedValue(modalConfig.y); 36 | const imageHeight = useSharedValue(modalConfig.height); 37 | const imageWidth = useSharedValue(modalConfig.width); 38 | 39 | useEffect(() => { 40 | offset.value = withTiming(1, {}, () => { 41 | oldTranslateX.value = 0; 42 | oldTranslateY.value = 0; 43 | imageHeight.value = WINDOW_HEIGHT; 44 | imageWidth.value = WINDOW_WIDTH; 45 | }); 46 | colorOffset.value = withTiming(1); 47 | // eslint-disable-next-line react-hooks/exhaustive-deps 48 | }, []); 49 | 50 | /** 51 | * function use to close the modal 52 | */ 53 | const onPressClose = () => { 54 | colorOffset.value = withTiming(0); 55 | offset.value = withTiming(0, {}, () => { 56 | runOnJS(setModalConfig)({ 57 | x: 0, 58 | y: 0, 59 | width: 0, 60 | height: 0, 61 | visible: false, 62 | }); 63 | }); 64 | }; 65 | 66 | /** 67 | * This function use to update translate and scale values 68 | * @param newTranslateX 69 | * @param newTranslateY 70 | * @param newScale 71 | */ 72 | const updateTranslate = ( 73 | newTranslateX: number, 74 | newTranslateY: number, 75 | newScale: number 76 | ) => { 77 | 'worklet'; 78 | const maxTranslateX = (WINDOW_WIDTH / 2) * newScale - WINDOW_WIDTH / 2; 79 | const minTranslateX = -maxTranslateX; 80 | 81 | const maxTranslateY = (WINDOW_HEIGHT / 2) * newScale - WINDOW_HEIGHT / 2; 82 | const minTranslateY = -maxTranslateY; 83 | 84 | if (newTranslateX > maxTranslateX) { 85 | translateX.value = maxTranslateX; 86 | } else if (newTranslateX < minTranslateX) { 87 | translateX.value = minTranslateX; 88 | } else { 89 | translateX.value = newTranslateX; 90 | } 91 | 92 | if (newTranslateY > maxTranslateY) { 93 | translateY.value = maxTranslateY; 94 | } else if (newTranslateY < minTranslateY) { 95 | translateY.value = minTranslateY; 96 | } else { 97 | translateY.value = newTranslateY; 98 | } 99 | }; 100 | 101 | /** 102 | * This function is used to reset all position and scale values 103 | */ 104 | const resetValues = () => { 105 | 'worklet'; 106 | scale.value = withTiming(1); 107 | translateY.value = withTiming(0); 108 | translateX.value = withTiming(0); 109 | saveScale.value = withTiming(1); 110 | oldTranslateX.value = withTiming(0); 111 | oldTranslateY.value = withTiming(0); 112 | }; 113 | 114 | /** 115 | * Pan gesture handler use to move the image after zoom and swipe down to close modal 116 | */ 117 | const panGestureEvent = Gesture.Pan() 118 | .onChange(eventData => { 119 | if (scale.value > 1) { 120 | const newTranslateX = eventData.translationX + oldTranslateX.value; 121 | const newTranslateY = eventData.translationY + oldTranslateY.value; 122 | updateTranslate(newTranslateX, newTranslateY, scale.value); 123 | } else if (swipeDownCloseEnabled) { 124 | colorOffset.value -= StaticValues.colorOpacityThreshold; 125 | translateY.value = eventData.translationY + oldTranslateY.value; 126 | } 127 | }) 128 | .onEnd(() => { 129 | if (scale.value === 1 && swipeDownCloseEnabled) { 130 | colorOffset.value = withTiming(0); 131 | offset.value = withTiming(0, {}, () => { 132 | runOnJS(setModalConfig)({ 133 | x: 0, 134 | y: 0, 135 | width: 0, 136 | height: 0, 137 | visible: false, 138 | }); 139 | }); 140 | } 141 | oldTranslateX.value = translateX.value; 142 | oldTranslateY.value = translateY.value; 143 | }); 144 | 145 | /** 146 | * Tap gesture handler use to double tap to zoom in/out 147 | */ 148 | const doubleTapEvent = Gesture.Tap() 149 | .numberOfTaps(2) 150 | .enabled(doubleTapZoomEnabled ?? true) 151 | .onEnd(eventData => { 152 | if (scale.value !== 1) { 153 | resetValues(); 154 | } else { 155 | scale.value = withTiming(2); 156 | saveScale.value = 2; 157 | translateX.value = withTiming( 158 | ((WINDOW_WIDTH / 2 - eventData.x) * 1) / 2 159 | ); 160 | translateY.value = withTiming( 161 | ((WINDOW_HEIGHT / 2 - eventData.y) * 1) / 2 162 | ); 163 | oldTranslateX.value = ((WINDOW_WIDTH / 2 - eventData.x) * 1) / 2; 164 | oldTranslateY.value = ((WINDOW_HEIGHT / 2 - eventData.y) * 1) / 2; 165 | } 166 | }); 167 | 168 | /** 169 | * Pinch gestures handler for pinch to zoom in/out 170 | */ 171 | const pinchGestureEvent = Gesture.Pinch() 172 | .enabled(pinchZoomEnabled ?? true) 173 | .onChange(eventData => { 174 | const updatedScale = saveScale.value * eventData.scale; 175 | if (updatedScale < 1) { 176 | resetValues(); 177 | } else { 178 | scale.value = updatedScale; 179 | const newTranslateX = oldTranslateX.value; 180 | const newTranslateY = oldTranslateY.value; 181 | updateTranslate(newTranslateX, newTranslateY, updatedScale); 182 | } 183 | }) 184 | .onEnd(() => { 185 | saveScale.value = scale.value; 186 | oldTranslateX.value = translateX.value; 187 | oldTranslateY.value = translateY.value; 188 | if (scale.value < 1.1) { 189 | resetValues(); 190 | } 191 | }); 192 | 193 | /** 194 | * Use to update scale, top and left position of image 195 | */ 196 | const animatedImageStyle = useAnimatedStyle(() => ({ 197 | height: imageHeight.value, 198 | width: imageWidth.value, 199 | transform: [{ scale: scale.value }], 200 | top: oldTranslateY.value, 201 | left: oldTranslateX.value, 202 | })); 203 | 204 | /** 205 | * Use to animate the modal background 206 | */ 207 | const modalAnimatedStyle = useAnimatedStyle(() => ({ 208 | backgroundColor: interpolateColor( 209 | colorOffset.value, 210 | [0, 1], 211 | [Colors.transparent, Colors.black] 212 | ), 213 | })); 214 | 215 | /** 216 | * Use to animate size and position of image 217 | */ 218 | const imageAnimatedStyle = useAnimatedStyle(() => ({ 219 | height: interpolate( 220 | offset.value, 221 | [0, 1], 222 | [modalConfig.height, WINDOW_HEIGHT] 223 | ), 224 | width: interpolate(offset.value, [0, 1], [modalConfig.width, WINDOW_WIDTH]), 225 | top: interpolate(offset.value, [0, 1], [modalConfig.y, translateY.value]), 226 | left: interpolate(offset.value, [0, 1], [modalConfig.x, translateX.value]), 227 | })); 228 | 229 | /** 230 | * Use to animate the header opacity 231 | */ 232 | const headerOpacityAnimation = useAnimatedStyle(() => ({ 233 | opacity: interpolate(colorOffset.value, [0, 1], [0, 1]), 234 | })); 235 | 236 | return { 237 | loading, 238 | setLoading, 239 | onPressClose, 240 | animatedImageRef, 241 | imageAnimatedStyle, 242 | modalAnimatedStyle, 243 | animatedImageStyle, 244 | headerOpacityAnimation, 245 | panGestureEvent, 246 | pinchGestureEvent, 247 | doubleTapEvent, 248 | }; 249 | }; 250 | 251 | export default useImageModal; 252 | -------------------------------------------------------------------------------- /src/components/ImagePreview/hooks/useImagePreview.ts: -------------------------------------------------------------------------------- 1 | import { useRef, useState } from 'react'; 2 | import type { Image } from 'react-native'; 3 | import type { ModalConfigType } from '../Types'; 4 | 5 | const useImagePreview = () => { 6 | const [modalConfig, setModalConfig] = useState({ 7 | x: 0, 8 | y: 0, 9 | height: 0, 10 | width: 0, 11 | visible: false, 12 | }); 13 | const imageRef = useRef(null); 14 | const [loading, setLoading] = useState(false); 15 | const [error, setError] = useState(false); 16 | 17 | /** 18 | * Use to get the position and size of image and set to modalConfig 19 | */ 20 | const onPressImage = () => { 21 | imageRef.current?.measure((_ox, _oy, width, height, px, py) => { 22 | setModalConfig({ 23 | x: px, 24 | y: py, 25 | width: width, 26 | height: height, 27 | visible: true, 28 | }); 29 | }); 30 | }; 31 | 32 | return { 33 | modalConfig, 34 | setModalConfig, 35 | onPressImage, 36 | imageRef, 37 | loading, 38 | setLoading, 39 | error, 40 | setError, 41 | }; 42 | }; 43 | 44 | export default useImagePreview; 45 | -------------------------------------------------------------------------------- /src/components/ImagePreview/index.ts: -------------------------------------------------------------------------------- 1 | export { default as ImagePreview } from './ImagePreview'; 2 | export * from './Types'; 3 | -------------------------------------------------------------------------------- /src/components/index.ts: -------------------------------------------------------------------------------- 1 | export * from './ImagePreview'; 2 | -------------------------------------------------------------------------------- /src/constants/StaticValues.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | colorOpacityThreshold: 0.009, 3 | }; 4 | -------------------------------------------------------------------------------- /src/constants/Strings.ts: -------------------------------------------------------------------------------- 1 | export default { 2 | close: 'Close', 3 | }; 4 | -------------------------------------------------------------------------------- /src/constants/index.ts: -------------------------------------------------------------------------------- 1 | export { default as StaticValues } from './StaticValues'; 2 | export { default as Strings } from './Strings'; 3 | -------------------------------------------------------------------------------- /src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './components'; 2 | -------------------------------------------------------------------------------- /src/theme/Colors.ts: -------------------------------------------------------------------------------- 1 | const colors = { 2 | white: '#ffffff', 3 | black: '#000000', 4 | blue: '#05259b', 5 | transparent: 'transparent', 6 | }; 7 | 8 | export default colors; 9 | -------------------------------------------------------------------------------- /src/theme/Metrics.ts: -------------------------------------------------------------------------------- 1 | import { Dimensions, PixelRatio } from 'react-native'; 2 | 3 | let { width, height } = Dimensions.get('window'); 4 | if (width > height) { 5 | [width, height] = [height, width]; 6 | } 7 | //Guideline sizes are based on standard ~5" screen mobile device 8 | 9 | const guidelineBaseWidth = 375; 10 | 11 | const guidelineBaseHeight = 812; 12 | 13 | const horizontalScale = (size: number) => (width / guidelineBaseWidth) * size; 14 | 15 | const verticalScale = (size: number) => (height / guidelineBaseHeight) * size; 16 | 17 | const moderateScale = (size: number, factor = 0.5) => 18 | size + (horizontalScale(size) - size) * factor; 19 | 20 | const { roundToNearestPixel } = PixelRatio; 21 | 22 | export default { 23 | horizontalScale, 24 | verticalScale, 25 | moderateScale, 26 | width, 27 | height, 28 | roundToNearestPixel, 29 | }; 30 | -------------------------------------------------------------------------------- /src/theme/index.ts: -------------------------------------------------------------------------------- 1 | export { default as Colors } from './Colors'; 2 | export { default as Metrics } from './Metrics'; 3 | -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "baseUrl": ".", 4 | "declaration": true, 5 | "esModuleInterop": true, 6 | "allowUnreachableCode": false, 7 | "allowUnusedLabels": false, 8 | "jsx": "react", 9 | "lib": ["ESNext"], 10 | "module": "ESNext", 11 | "importsNotUsedAsValues": "error", 12 | "forceConsistentCasingInFileNames": true, 13 | "moduleResolution": "Node", 14 | "noFallthroughCasesInSwitch": true, 15 | "noImplicitReturns": true, 16 | "noImplicitUseStrict": false, 17 | "noStrictGenericChecks": false, 18 | "noUnusedLocals": true, 19 | "noUnusedParameters": true, 20 | "resolveJsonModule": true, 21 | "noEmitOnError": true, 22 | "outDir": "./lib", 23 | "skipLibCheck": true, 24 | "sourceMap": true, 25 | "strict": true, 26 | "target": "ES2018" 27 | }, 28 | "exclude": ["example/node_modules/**", "node_modules/**", "**/__tests__/*"], 29 | "include": ["src"] 30 | } 31 | --------------------------------------------------------------------------------