├── .circleci └── config.yml ├── .editorconfig ├── .eslintignore ├── .eslintrc.json ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── stale.yml ├── .gitignore ├── .prettierrc.js ├── .watchmanconfig ├── CONTRIBUTING.md ├── LICENSE ├── PULL_REQUEST_TEMPLATE.md ├── README.md ├── azure-pipelines.yml ├── babel.config.js ├── demo ├── .buckconfig ├── .bundle │ └── config ├── .eslintrc.js ├── .gitignore ├── .prettierrc.js ├── .ruby-version ├── .watchmanconfig ├── App.tsx ├── AppWithNavigation.tsx ├── Gemfile ├── __tests__ │ └── App-test.tsx ├── _node-version ├── android │ ├── app │ │ ├── _BUCK │ │ ├── build.gradle │ │ ├── build_defs.bzl │ │ ├── debug.keystore │ │ ├── proguard-rules.pro │ │ └── src │ │ │ ├── debug │ │ │ ├── AndroidManifest.xml │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── demo │ │ │ │ └── ReactNativeFlipper.java │ │ │ └── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── java │ │ │ └── com │ │ │ │ └── demo │ │ │ │ ├── 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 ├── indexSnapshot.js ├── ios │ ├── Podfile │ ├── Podfile.lock │ ├── _xcode.env │ ├── demo.xcodeproj │ │ ├── project.pbxproj │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── demo.xcscheme │ ├── demo.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── demo │ │ ├── AppDelegate.h │ │ ├── AppDelegate.mm │ │ ├── Images.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── LaunchScreen.storyboard │ │ └── main.m │ └── demoTests │ │ ├── Info.plist │ │ └── demoTests.m ├── metro.config.js ├── package.json ├── pixels-catcher.json ├── run_android_debug.sh ├── run_android_release.sh ├── run_android_test.sh ├── run_ios_debug.sh ├── run_ios_release.sh ├── run_ios_test.sh ├── snapshots │ ├── android │ │ ├── diffs │ │ │ ├── AppSnapshot.png │ │ │ ├── HomeScreen.png │ │ │ ├── WebViewTest.png │ │ │ ├── longContent.png │ │ │ └── someComponent.png │ │ ├── refImages │ │ │ ├── AppSnapshot.png │ │ │ ├── AppSnapshotWithWrongRefImg.png │ │ │ ├── HomeScreen.png │ │ │ ├── WebViewTest.png │ │ │ ├── longContent.png │ │ │ └── someComponent.png │ │ └── uploads │ │ │ ├── AppSnapshot.png │ │ │ ├── HomeScreen.png │ │ │ ├── WebViewTest.png │ │ │ ├── longContent.png │ │ │ └── someComponent.png │ ├── iPhone6 │ │ └── refImages │ │ │ ├── AppSnapshot.png │ │ │ ├── AppSnapshotWithWrongRefImg.png │ │ │ ├── WebViewTest.png │ │ │ ├── longContent.png │ │ │ └── someComponent.png │ └── ios │ │ ├── diffs │ │ ├── AppSnapshot.png │ │ ├── HomeScreen.png │ │ ├── WebViewTest.png │ │ ├── longContent.png │ │ └── someComponent.png │ │ ├── refImages │ │ ├── AppSnapshot.png │ │ ├── AppSnapshotWithWrongRefImg.png │ │ ├── HomeScreen.png │ │ ├── WebViewTest.png │ │ ├── longContent.png │ │ └── someComponent.png │ │ └── uploads │ │ ├── AppSnapshot.png │ │ ├── HomeScreen.png │ │ ├── WebViewTest.png │ │ ├── longContent.png │ │ └── someComponent.png └── tsconfig.json ├── metro.config.js ├── package.json ├── res ├── azureDevops.png └── testResults.png ├── scripts └── create_android_emulator.sh └── src ├── client ├── Snapshot.tsx ├── SnapshotsContainer.tsx ├── __tests__ │ ├── Snapshot.js │ ├── SnapshotsContainer.js │ ├── __snapshots__ │ │ ├── Snapshot.js.snap │ │ ├── SnapshotsContainer.js.snap │ │ └── index.js.snap │ ├── index.js │ └── snapshotsManager.js ├── index.ts ├── snapshotsManager.ts ├── tsconfig.json └── utils │ ├── __tests__ │ ├── __snapshots__ │ │ └── compareToReference.js.snap │ └── compareToReference.js │ ├── compareToReference.ts │ ├── log.ts │ └── network.ts └── runner ├── TestsRunner.ts ├── azure └── AzurePublisher.ts ├── cli.ts ├── server ├── compareImages.ts ├── dummy.png └── server.ts ├── tsconfig.json └── utils ├── Reporter.ts ├── __tests__ ├── __snapshots__ │ ├── log.js.snap │ └── readConfig.js.snap ├── isCommand.js ├── log.js └── readConfig.js ├── delay.ts ├── device ├── AndroidDevice.ts ├── AndroidEmulator.ts ├── AndroidEmulatorCmd.ts ├── DeviceInterface.ts ├── IosSimulator.ts ├── __tests__ │ ├── AndroidDevice.js │ ├── AndroidEmulator.js │ ├── AndroidEmulatorCmd.js │ ├── IosSimulator.js │ ├── __snapshots__ │ │ ├── AndroidEmulator.js.snap │ │ └── deviceProvider.js.snap │ └── deviceProvider.js └── deviceProvider.ts ├── exec.ts ├── isCommand.ts ├── log.ts ├── readConfig.ts └── timeToSec.ts /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | docker: 5 | - image: circleci/node:14 6 | steps: 7 | - checkout 8 | - run: npm install 9 | - run: npm run lint 10 | - run: npm run check-types 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # EditorConfig is awesome: http://EditorConfig.org 2 | 3 | # top-most EditorConfig file 4 | root = true 5 | 6 | [*] 7 | charset = utf-8 8 | end_of_line = lf 9 | insert_final_newline = true 10 | 11 | [**/{.js,.ts{x},package.json}] 12 | indent_style = space 13 | indent_size = 2 14 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | demo/**/* 2 | lib/**/* 3 | preprocessor.js 4 | -------------------------------------------------------------------------------- /.eslintrc.json: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "browser": true, 4 | "es2021": true, 5 | "es6": true, 6 | "jasmine": true 7 | }, 8 | "extends": [ 9 | "plugin:react/recommended", 10 | "airbnb" 11 | ], 12 | "globals": { 13 | "jest": false, 14 | "__DEV__": false 15 | }, 16 | "settings": { 17 | "import/resolver": { 18 | "node": { 19 | "extensions": [".js", ".jsx", ".ts", ".tsx"] 20 | } 21 | } 22 | }, 23 | "parser": "@typescript-eslint/parser", 24 | "parserOptions": { 25 | "ecmaFeatures": { 26 | "jsx": true 27 | }, 28 | "ecmaVersion": 12, 29 | "sourceType": "module" 30 | }, 31 | "plugins": [ 32 | "react", 33 | "@typescript-eslint" 34 | ], 35 | "rules": { 36 | "import/no-extraneous-dependencies": 0, 37 | "react/destructuring-assignment": 0, 38 | "operator-linebreak": 0, 39 | "react/sort-comp": 0, 40 | "no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 0 }], 41 | "no-underscore-dangle": 0, 42 | "class-methods-use-this": 0, 43 | "import/extensions": 0, 44 | "no-plusplus": 0, 45 | "no-await-in-loop": 0, 46 | "max-classes-per-file": 0, 47 | "global-require": 0, 48 | "react/jsx-filename-extension": 0 49 | }, 50 | "overrides": [ 51 | { 52 | "files": ["*.ts", "*.tsx"], 53 | "parser": "@typescript-eslint/parser", 54 | "rules": { 55 | "@typescript-eslint/no-unused-vars": "warn", 56 | "@typescript-eslint/explicit-function-return-type": "error", 57 | "@typescript-eslint/consistent-type-imports": [ 58 | 2, 59 | { "prefer": "type-imports" } 60 | ] 61 | } 62 | } 63 | ] 64 | 65 | } 66 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **To Reproduce** 11 | 12 | - [ ] I checked the demo project and cannot reproduce the issue 13 | - [ ] I checked the demo project and the issue exists 14 | 15 | Steps to reproduce the behavior: 16 | 1. Render PDF with '...' 17 | 2. Other actions '...' 18 | 3. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Emulator information:** 27 | - Version 28 | - etc. 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | 5 | --- 6 | 7 | **Is your feature request related to a problem? Please describe.** 8 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 9 | 10 | **Describe the solution you'd like** 11 | A clear and concise description of what you want to happen. 12 | 13 | **Describe alternatives you've considered** 14 | A clear and concise description of any alternative solutions or features you've considered. 15 | 16 | **Additional context** 17 | Add any other context or screenshots about the feature request here. 18 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 60 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 5 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - pinned 8 | # Label to use when marking an issue as stale 9 | staleLabel: wontfix 10 | # Comment to post when marking an issue as stale. Set to `false` to disable 11 | markComment: > 12 | This issue has been automatically marked as stale because it has not had 13 | recent activity. It will be closed if no further activity occurs. Thank you 14 | for your contributions. 15 | # Comment to post when closing a stale issue. Set to `false` to disable 16 | closeComment: false 17 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | package-lock.json 2 | .vscode 3 | 4 | # generated 5 | /lib/ 6 | demo/ios_logs.log 7 | demo/android_logs.log 8 | yarn.lock 9 | 10 | tmp/ 11 | coverage/ 12 | 13 | # OSX 14 | # 15 | .DS_Store 16 | 17 | # node.js 18 | # 19 | node_modules/ 20 | npm-debug.log 21 | yarn-error.log 22 | pixels-catcher*.tgz 23 | package*/ 24 | demo/junit.xml 25 | 26 | # Xcode 27 | # 28 | build/ 29 | *.pbxuser 30 | !default.pbxuser 31 | *.mode1v3 32 | !default.mode1v3 33 | *.mode2v3 34 | !default.mode2v3 35 | *.perspectivev3 36 | !default.perspectivev3 37 | xcuserdata 38 | *.xccheckout 39 | *.moved-aside 40 | DerivedData 41 | *.hmap 42 | *.ipa 43 | *.xcuserstate 44 | project.xcworkspace 45 | 46 | 47 | # Android/IntelliJ 48 | # 49 | build/ 50 | .idea 51 | .gradle 52 | local.properties 53 | *.iml 54 | 55 | # BUCK 56 | buck-out/ 57 | \.buckd/ 58 | *.keystore 59 | -------------------------------------------------------------------------------- /.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | bracketSpacing: true, 3 | jsxBracketSameLine: true, 4 | singleQuote: true, 5 | trailingComma: 'all', 6 | arrowParens: 'avoid', 7 | }; 8 | -------------------------------------------------------------------------------- /.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing to react-native-PixelsCatcher 2 | 3 | :+1::tada: Thanks for taking the time to contribute! :tada::+1: 4 | 5 | ## Styleguides 6 | 7 | ### Git Commit Messages 8 | 9 | * Use the present tense ("Add feature" not "Added feature") 10 | * Use the imperative mood ("Move cursor to..." not "Moves cursor to...") 11 | * Limit the first line to 72 characters or less 12 | * Reference issues and pull requests liberally after the first line 13 | * When only changing documentation, include `[ci skip]` in the commit title 14 | * Consider starting the commit message with an applicable emoji: 15 | * :art: `:art:` when improving the format/structure of the code 16 | * :racehorse: `:racehorse:` when improving performance 17 | * :non-potable_water: `:non-potable_water:` when plugging memory leaks 18 | * :memo: `:memo:` when writing docs 19 | * :lollipop: `:lollipop:` when fixing Android 20 | * :apple: `:apple:` when fixing iOS 21 | * :bug: `:bug:` when fixing a bug 22 | * :fire: `:fire:` when removing code or files 23 | * :green_heart: `:green_heart:` when fixing the CI build 24 | * :white_check_mark: `:white_check_mark:` when adding tests 25 | * :lock: `:lock:` when dealing with security 26 | * :arrow_up: `:arrow_up:` when upgrading dependencies 27 | * :arrow_down: `:arrow_down:` when downgrading dependencies 28 | * :shirt: `:shirt:` when removing linter warnings 29 | 30 | ### JavaScript Styleguide 31 | 32 | * All JavaScript must adhere to [JavaScript Standard Style](https://standardjs.com/). 33 | 34 | ### Java Styleguide 35 | 36 | ### Objective-C 37 | 38 | ### Documentation Styleguide 39 | 40 | * Use [Markdown](https://daringfireball.net/projects/markdown). 41 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 - present Maksym Rusynyk 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 | -------------------------------------------------------------------------------- /PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Description of changes 2 | 3 | ### I did Exploratory testing: 4 | - [ ] android 5 | - [ ] ios 6 | 7 | ### Can it be published to NPM? 8 | - [ ] Breaking change 9 | - [ ] Documentation is updated 10 | -------------------------------------------------------------------------------- /azure-pipelines.yml: -------------------------------------------------------------------------------- 1 | variables: 2 | MAC_RUNNER_IMAGE: 'macos-12' 3 | NODE_VERSION: '19.x' 4 | XCODE_VERSION: '14.2' 5 | 6 | trigger: 7 | branches: 8 | include: 9 | - master 10 | 11 | stages: 12 | - stage: Tests 13 | jobs: 14 | - job: UiTestsIOS 15 | pool: 16 | vmImage: '$(MAC_RUNNER_IMAGE)' 17 | steps: 18 | - task: NodeTool@0 19 | displayName: 'Set Node version $(NODE_VERSION)' 20 | inputs: 21 | versionSpec: $(NODE_VERSION) 22 | - script: npm run preinstall 23 | displayName: 'NPM PreInstall' 24 | workingDirectory: '$(Build.SourcesDirectory)/demo' 25 | - script: npm install 26 | displayName: 'NPM Install' 27 | workingDirectory: '$(Build.SourcesDirectory)/demo' 28 | - script: sudo xcode-select --switch /Applications/Xcode_$(XCODE_VERSION).app/Contents/Developer 29 | displayName: 'Select xcode $(XCODE_VERSION)' 30 | - script: ./run_ios_debug.sh 31 | displayName: 'Run tests' 32 | workingDirectory: '$(Build.SourcesDirectory)/demo' 33 | - publish: $(Build.SourcesDirectory)/demo/snapshots/ios 34 | condition: failed() 35 | artifact: screenshots_ios 36 | displayName: 'Publish test results' 37 | - task: PublishTestResults@2 38 | condition: succeededOrFailed() 39 | displayName: 'Publish test report' 40 | inputs: 41 | testRunner: JUnit 42 | testResultsFiles: '$(Build.SourcesDirectory)/demo/junit.xml' 43 | - script: ./node_modules/.bin/pixels-catcher ios debug azureAttachments 44 | condition: failed() 45 | env: 46 | SYSTEM_ACCESSTOKEN: $(System.AccessToken) 47 | workingDirectory: '$(Build.SourcesDirectory)/demo' 48 | displayName: 'Upload screenshots' 49 | - task: PublishBuildArtifacts@1 50 | displayName: Publish Device Log Artifacts 51 | inputs: 52 | pathtoPublish: $(System.DefaultWorkingDirectory)/demo/ios_logs.log 53 | artifactName: ios_logs 54 | - job: UiTestsAndroid 55 | pool: 56 | vmImage: '$(MAC_RUNNER_IMAGE)' 57 | steps: 58 | - task: NodeTool@0 59 | displayName: 'Set Node version $(NODE_VERSION)' 60 | inputs: 61 | versionSpec: $(NODE_VERSION) 62 | - script: ./scripts/create_android_emulator.sh 63 | displayName: 'Create and start Android Emulator' 64 | - script: npm run preinstall 65 | displayName: 'NPM PreInstall' 66 | workingDirectory: '$(Build.SourcesDirectory)/demo' 67 | - script: npm install 68 | displayName: 'NPM Install' 69 | workingDirectory: '$(Build.SourcesDirectory)/demo' 70 | - task: JavaToolInstaller@0 71 | inputs: 72 | versionSpec: '11' 73 | jdkArchitectureOption: 'x64' 74 | jdkSourceOption: 'PreInstalled' 75 | - script: ./run_android_debug.sh 76 | displayName: 'Run tests' 77 | workingDirectory: '$(Build.SourcesDirectory)/demo' 78 | - publish: $(Build.SourcesDirectory)/demo/snapshots/android 79 | condition: failed() 80 | artifact: screenshots_android 81 | displayName: 'Publish test results' 82 | - task: PublishTestResults@2 83 | condition: succeededOrFailed() 84 | displayName: 'Publish test report' 85 | inputs: 86 | testRunner: JUnit 87 | testResultsFiles: '$(Build.SourcesDirectory)/demo/junit.xml' 88 | - script: ./node_modules/.bin/pixels-catcher android debug azureAttachments 89 | condition: failed() 90 | env: 91 | SYSTEM_ACCESSTOKEN: $(System.AccessToken) 92 | workingDirectory: '$(Build.SourcesDirectory)/demo' 93 | displayName: 'Upload screenshots' 94 | - task: PublishBuildArtifacts@1 95 | displayName: Publish Device Log Artifacts 96 | inputs: 97 | pathtoPublish: $(System.DefaultWorkingDirectory)/demo/android_logs.log 98 | artifactName: android_logs 99 | -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [ 3 | 'module:metro-react-native-babel-preset', 4 | ], 5 | }; 6 | -------------------------------------------------------------------------------- /demo/.buckconfig: -------------------------------------------------------------------------------- 1 | 2 | [android] 3 | target = Google Inc.:Google APIs:23 4 | 5 | [maven_repositories] 6 | central = https://repo1.maven.org/maven2 7 | -------------------------------------------------------------------------------- /demo/.bundle/config: -------------------------------------------------------------------------------- 1 | BUNDLE_PATH: "vendor/bundle" 2 | BUNDLE_FORCE_RUBY_PLATFORM: 1 3 | -------------------------------------------------------------------------------- /demo/.eslintrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | root: true, 3 | extends: '@react-native-community', 4 | parser: '@typescript-eslint/parser', 5 | plugins: ['@typescript-eslint'], 6 | overrides: [ 7 | { 8 | files: ['*.ts', '*.tsx'], 9 | rules: { 10 | '@typescript-eslint/no-shadow': ['error'], 11 | 'no-shadow': 'off', 12 | 'no-undef': 'off', 13 | }, 14 | }, 15 | ], 16 | }; 17 | -------------------------------------------------------------------------------- /demo/.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 | 41 | # BUCK 42 | buck-out/ 43 | \.buckd/ 44 | *.keystore 45 | !debug.keystore 46 | 47 | # fastlane 48 | # 49 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 50 | # screenshots whenever they are needed. 51 | # For more information about the recommended setup visit: 52 | # https://docs.fastlane.tools/best-practices/source-control/ 53 | 54 | **/fastlane/report.xml 55 | **/fastlane/Preview.html 56 | **/fastlane/screenshots 57 | **/fastlane/test_output 58 | 59 | # Bundle artifact 60 | *.jsbundle 61 | 62 | # Ruby / CocoaPods 63 | /ios/Pods/ 64 | /vendor/bundle/ 65 | -------------------------------------------------------------------------------- /demo/.prettierrc.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | arrowParens: 'avoid', 3 | bracketSameLine: true, 4 | bracketSpacing: true, 5 | singleQuote: true, 6 | trailingComma: 'all', 7 | }; 8 | -------------------------------------------------------------------------------- /demo/.ruby-version: -------------------------------------------------------------------------------- 1 | 2.7.5 2 | -------------------------------------------------------------------------------- /demo/.watchmanconfig: -------------------------------------------------------------------------------- 1 | {} -------------------------------------------------------------------------------- /demo/App.tsx: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample React Native App 3 | * https://github.com/facebook/react-native 4 | * 5 | * Generated with the TypeScript template 6 | * https://github.com/react-native-community/react-native-template-typescript 7 | * 8 | * @format 9 | */ 10 | 11 | import React, {type PropsWithChildren} from 'react'; 12 | import { 13 | SafeAreaView, 14 | ScrollView, 15 | StatusBar, 16 | StyleSheet, 17 | Text, 18 | useColorScheme, 19 | View, 20 | } from 'react-native'; 21 | 22 | import { 23 | Colors, 24 | DebugInstructions, 25 | Header, 26 | LearnMoreLinks, 27 | ReloadInstructions, 28 | } from 'react-native/Libraries/NewAppScreen'; 29 | 30 | const Section: React.FC< 31 | PropsWithChildren<{ 32 | title: string; 33 | }> 34 | > = ({children, title}) => { 35 | const isDarkMode = useColorScheme() === 'dark'; 36 | return ( 37 | 38 | 45 | {title} 46 | 47 | 54 | {children} 55 | 56 | 57 | ); 58 | }; 59 | 60 | const App = () => { 61 | const isDarkMode = useColorScheme() === 'dark'; 62 | 63 | const backgroundStyle = { 64 | backgroundColor: isDarkMode ? Colors.darker : Colors.lighter, 65 | }; 66 | 67 | return ( 68 | 69 | 73 | 76 |
77 | 81 |
82 | Edit App.tsx to change this 83 | screen and then come back to see your edits. 84 |
85 |
86 | 87 |
88 |
89 | 90 |
91 |
92 | Read the docs to discover what to do next: 93 |
94 | 95 |
96 | 97 | 98 | ); 99 | }; 100 | 101 | const styles = StyleSheet.create({ 102 | sectionContainer: { 103 | marginTop: 32, 104 | paddingHorizontal: 24, 105 | }, 106 | sectionTitle: { 107 | fontSize: 24, 108 | fontWeight: '600', 109 | }, 110 | sectionDescription: { 111 | marginTop: 8, 112 | fontSize: 18, 113 | fontWeight: '400', 114 | }, 115 | highlight: { 116 | fontWeight: '700', 117 | }, 118 | }); 119 | 120 | export default App; 121 | -------------------------------------------------------------------------------- /demo/AppWithNavigation.tsx: -------------------------------------------------------------------------------- 1 | import * as React from 'react'; 2 | import { View, Text } from 'react-native'; 3 | import { NavigationContainer, useNavigation } from '@react-navigation/native'; 4 | import { createStackNavigator } from '@react-navigation/stack'; 5 | import { Button } from 'react-native'; 6 | 7 | function NavToDetails() { 8 | const navigation = useNavigation(); 9 | return ( 10 |