diff --git a/FabricExample/.bundle/config b/FabricExample/.bundle/config new file mode 100644 index 00000000..848943bb --- /dev/null +++ b/FabricExample/.bundle/config @@ -0,0 +1,2 @@ +BUNDLE_PATH: "vendor/bundle" +BUNDLE_FORCE_RUBY_PLATFORM: 1 diff --git a/FabricExample/.eslintrc.js b/FabricExample/.eslintrc.js new file mode 100644 index 00000000..40c6dcd0 --- /dev/null +++ b/FabricExample/.eslintrc.js @@ -0,0 +1,4 @@ +module.exports = { + root: true, + extends: '@react-native-community', +}; diff --git a/FabricExample/.gitignore b/FabricExample/.gitignore new file mode 100644 index 00000000..16f8c307 --- /dev/null +++ b/FabricExample/.gitignore @@ -0,0 +1,63 @@ +# OSX +# +.DS_Store + +# Xcode +# +build/ +*.pbxuser +!default.pbxuser +*.mode1v3 +!default.mode1v3 +*.mode2v3 +!default.mode2v3 +*.perspectivev3 +!default.perspectivev3 +xcuserdata +*.xccheckout +*.moved-aside +DerivedData +*.hmap +*.ipa +*.xcuserstate +ios/.xcode.env.local + +# Android/IntelliJ +# +build/ +.idea +.gradle +local.properties +*.iml +*.hprof +.cxx/ +*.keystore +!debug.keystore + +# node.js +# +node_modules/ +npm-debug.log +yarn-error.log + +# fastlane +# +# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the +# screenshots whenever they are needed. +# For more information about the recommended setup visit: +# https://docs.fastlane.tools/best-practices/source-control/ + +**/fastlane/report.xml +**/fastlane/Preview.html +**/fastlane/screenshots +**/fastlane/test_output + +# Bundle artifact +*.jsbundle + +# Ruby / CocoaPods +/ios/Pods/ +/vendor/bundle/ + +# Temporary files created by Metro to check the health of the file watcher +.metro-health-check* diff --git a/FabricExample/.prettierrc.js b/FabricExample/.prettierrc.js new file mode 100644 index 00000000..2b540746 --- /dev/null +++ b/FabricExample/.prettierrc.js @@ -0,0 +1,7 @@ +module.exports = { + arrowParens: 'avoid', + bracketSameLine: true, + bracketSpacing: false, + singleQuote: true, + trailingComma: 'all', +}; diff --git a/FabricExample/.ruby-version b/FabricExample/.ruby-version new file mode 100644 index 00000000..49cdd668 --- /dev/null +++ b/FabricExample/.ruby-version @@ -0,0 +1 @@ +2.7.6 diff --git a/FabricExample/.watchmanconfig b/FabricExample/.watchmanconfig new file mode 100644 index 00000000..9e26dfee --- /dev/null +++ b/FabricExample/.watchmanconfig @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/FabricExample/App.tsx b/FabricExample/App.tsx new file mode 100644 index 00000000..5e156ce2 --- /dev/null +++ b/FabricExample/App.tsx @@ -0,0 +1,127 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + +import React, {useCallback, useMemo, useState} from 'react'; +import { + Button, + Keyboard, + SafeAreaView, + StyleSheet, + Text, + TouchableOpacity, + View, +} from 'react-native'; +import Basic from './examples/Basic'; +import Functional from './examples/Functional'; +import GetSetClear from './examples/GetSetClear'; +import MergeItem from './examples/MergeItem'; + +const SCREENS = { + Functional, + GetSetClear, + MergeItem, + Basic, +}; + +export default function App(): JSX.Element { + const [iteration, setIteration] = useState(0); + const [currentTest, setCurrentTest] = useState(SCREENS.Functional); + + const dismissKeyboard = useCallback(Keyboard.dismiss, []); + const simulateRestart = useCallback( + () => setIteration(iteration + 1), + [iteration], + ); + const navigationBar = useMemo( + () => + Object.values(SCREENS).map(t => { + const {testId, title} = t; + return ( +