From 8e5e7865e2f2fe1971e102e62bd4e7c528ab5fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oskar=20Kwas=CC=81niewski?= Date: Tue, 12 Sep 2023 15:27:43 +0200 Subject: [PATCH] feat: add visionos support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: address issues with scale, ScrollView prop feat: move min_visionos_version_supported to Helpers feat: implement `visionos_hoverStyle` prop chore: update README.MD fix: refactor visionos_hoverStyle to take a string and new arch support docs: add link to rn-tester's README.md (#5) chore: change VisionOS to visionOS (#13) chore: use `min_supported_versions` for third-party-podspecs (#18) chore: remove not necessary ifs TARGET_OS_VISION, minimise code diff (#22) feat: add visionos support add warning when using InputAccessoryView update platform naming fix: remove keyboard listerners and mark as unsupported (#25) * fix: remove keyboard listerners and mark as unsupported * chore: replace warn with warnOnce feat: support building visionOS with dynamic frameworks enabled (#28) chore: sync Podfile.lock with upstream, remove unnecessary #endif feat: add visionOS as separate target to fix iOS tests (#31) * feat: add visionOS as separate target to fix iOS tests * fix: disable multiple windows support * feat: add visionOS App Icon * fix: creating Release build Update README.md (#36) * Update README.md * fix: update README link * feat: add caution section * fix: bring back info about Hermes Add platform guidelines to README (#37) * Add platform guidelines to README * fix: link to docs Rename react-native package to @callstack/react-native-visionos (#35) * rename react-native package to @callstack/react-native-visionos * fix typo * Make JS and TS tests independent of react-native package name * change name in template * replace more refs in e2e tests * revert tests changes * disable js e2e tests for visionos * bring back react-native for other platforms compat * ci: run js, no e2e js Fix codegen issues for RNTester after renaming package (#40) feat: make hermes build for visionOS (#26) * [WIP] feat: make hermes build for visionOS * feat: point to callstack/hermes-visionos fork, update README * fix: remove USE_HERMES from project.pbxproj feat: align unnecessary compiler conditionals (#51) chore: sync Podfile.lock feat: implement OOT release script (#43) * feat: implement OOT release script * docs: add readme on Release process * fix: remove header file Co-authored-by: Michał Pierzchała * add reference --------- Co-authored-by: Michał Pierzchała feat: add visionOS template (#34) * Update CLI to v12.1.1 * feat: implement visionos react-native template * feat: modify template look * feat: add `@callstack/out-of-tree-platforms` to metro config * fix: metro config * feat: update supported platforms --------- Co-authored-by: szymonrybczak task(StatusBar component): show warn when using StatusBar (#49) * task(StatusBar component): show warn when using StatusBar * pr suggestions docs: update CMake instructions (#55) Fix iOS native tests (#58) * fix: remove unnecessary libevent.podspec * fix: make OCMock build for visionOS fix: remove unnecessary YogaKit pod (#61) feat: add warning while building Hermes that at least CMake 3.28.0 is required (#63) fix: RCTAlertController transparent background override added cornerRadius for hover style (#66) * added corner radius for hover style * fix: implement proper handling for old arch, reformat code --------- Co-authored-by: Oskar Kwaśniewski chore: sync Podfile.lock fix: don't warn users about the Keyboard API (#71) feat: implement visionos cli commands (#64) fix: use isVision instead of isVisionOS (#76) fix: release build bundle (#74) fix: remove duplicated isVision key (#78) fix: change resolver option name (#79) fix: RCTDeviceInfo UIApplicationDidChangeStatusBarOrientationNotification method fix: update README.md with corrected capitalization (#84) fix: upstream sync ifdefs fix: providing unsupported value to hoverStyle crashed the app (#88) fix: pointer events (#114) fix: hoverEffect for bridgeless mode (#92) refactor: remove unused RCTForegroundWindow (#94) fix: properly retrieve window when clicking DevMenu action (#95) sync with upstream chore: sync Podfile.lock docs: add how is it different from iOS version section (#91) docs: move to documentation website (#119) Update README.md (#121) * Update README.md * Update README.md Co-authored-by: Kacper Rożniata <56474758+krozniata@users.noreply.github.com> --------- Co-authored-by: Kacper Rożniata <56474758+krozniata@users.noreply.github.com> Update getting started link in Readme. (#123) Co-authored-by: christinamartinez chore: remove hover effect & add cursor: pointer (#122) * chore: remove hover effect * fix: set cursor pointer by default, update tests * feat(iOS): Implement cursor style prop --------- Co-authored-by: Saad Najmi chore: resync with upstream fix: change versio of @callstack/out-of-tree-platforms feat: make SwiftUI React Native entry point (#68) * feat: add Swift entrypoint [wip] add module maps to some RN modules to allow for swift c++ imports feat: implement RCTReactController and RCTSwiftUIAppDelegate feat: introduce new method to RCTAppDelegate * feat: modify template to use SwiftUI * fix: dimensions, use RCTMainWindow() * fix: fallback to DarkMode on visionOS * fix: use KeyWindow() in RCTPerfMonitor feat: update docs (#80) * feat: update docs * Update README.md Co-authored-by: Michał Pierzchała * Update README.md Co-authored-by: Michał Pierzchała * Update README.md Co-authored-by: Michał Pierzchała * Update README.md Co-authored-by: Michał Pierzchała * Update README.md Co-authored-by: Michał Pierzchała --------- Co-authored-by: Michał Pierzchała feat: add UIApplicationSceneManifest to template Create custom resolver and utils package for out-of-tree platforms (#32) * rename react-native package to @callstack/react-native-visionos * wip: metro setup for other platform * fix(flow): add .ios.visionos as support platform * fix some flow errors * fix flow * revert Platform.select change * revert KeyboardAvoidingView change * fix type * change kBundlePath to ios.visionos * fix: remove redundant isVisionOS * use custom resolver options to read platform for OOT * fix types * remove formatting * add/remove platform checks * document variant behavior * use visionOS Keyboard mock * use visionOS KeyboardAvoidingView mock * use visionOS InputAccessoryView mock * test: add test for metroPlatformResolver * move implementation to user space * create out-of-tree-platforms package and bring back resolver options * revert flow changes * revert sourceExts changes * update links * add comments * fix visionos typo * adjust lockfile * revert loadMetroConfig change * remove podfile lock * revert scripts changes Fix build step for `@callstack/out-of-tree-platforms` (#46) * feat: setup @callstack/out-of-tree-platforms to build properly * feat: add build packages step to `oot-release.js` script * chore: format package.json fix(#48) local build of @callstack/out-of-tree-platforms (#50) --- README.md | 147 +--- jest.config.js | 9 + packages/out-of-tree-platforms/.gitignore | 2 + packages/out-of-tree-platforms/README.md | 19 + packages/out-of-tree-platforms/index.js.flow | 1 + packages/out-of-tree-platforms/package.json | 27 + .../src/getPlatformResolver.js | 43 ++ packages/out-of-tree-platforms/src/index.js | 5 + .../Libraries/AppDelegate/RCTAppDelegate.mm | 5 +- .../Libraries/Components/Keyboard/Keyboard.js | 17 + .../Keyboard/KeyboardAvoidingView.js | 18 + .../Components/Pressable/Pressable.js | 12 +- .../__snapshots__/Pressable-test.js.snap | 80 ++ .../Components/ScrollView/ScrollView.js | 34 +- .../Components/StatusBar/StatusBar.js | 8 + .../TextInput/InputAccessoryView.js | 2 +- .../Touchable/TouchableHighlight.js | 17 +- .../Components/Touchable/TouchableOpacity.js | 9 +- .../TouchableHighlight-test.js.snap | 49 +- .../TouchableOpacity-test.js.snap | 3 + .../__snapshots__/Button-test.js.snap | 9 + .../LinkingIOS/React-RCTLinking.podspec | 2 + .../React-RCTAnimation.podspec | 2 + .../NewAppScreen/components/Header.js | 5 +- .../RCTPushNotificationManager.mm | 2 + .../SwiftExtensions/RCTMainWindow.swift | 34 + .../SwiftExtensions/RCTReactViewController.h | 16 + .../SwiftExtensions/RCTReactViewController.m | 71 ++ .../RCTRootViewRepresentable.swift | 32 + .../React-RCTSwiftExtensions.podspec | 27 + .../Libraries/Text/Text/RCTTextView.mm | 2 + .../Text/TextInput/RCTBaseTextInputView.mm | 4 + .../React-RCTWindowManager.podspec | 51 ++ .../Libraries/XR/React-RCTXR.podspec | 51 ++ packages/react-native/React-Core.podspec | 2 +- .../React/Base/RCTBundleURLProvider.mm | 3 + .../react-native/React/Base/RCTConstants.h | 3 + .../react-native/React/Base/RCTConstants.m | 3 + .../react-native/React/Base/RCTConvert.mm | 16 + .../react-native/React/Base/RCTKeyCommands.m | 5 +- packages/react-native/React/Base/RCTUtils.m | 5 + .../React/CoreModules/RCTAlertController.mm | 18 + .../React/CoreModules/RCTAppearance.mm | 4 +- .../React/CoreModules/RCTDevLoadingView.mm | 8 + .../React/CoreModules/RCTDevMenu.mm | 8 +- .../React/CoreModules/RCTDeviceInfo.mm | 15 +- .../React/CoreModules/RCTKeyboardObserver.mm | 6 + .../React/CoreModules/RCTStatusBarManager.mm | 22 +- .../CoreModules/React-CoreModules.podspec | 2 +- .../RCTInputAccessoryComponentView.mm | 4 + .../Modal/RCTFabricModalHostViewController.mm | 1 + .../ScrollView/RCTScrollViewComponentView.mm | 4 + .../Text/RCTParagraphComponentView.mm | 2 + .../TextInput/RCTTextInputComponentView.mm | 2 + .../TextInput/RCTTextInputUtils.mm | 2 + .../React/Fabric/RCTSurfacePointerHandler.mm | 18 +- .../React/Fabric/RCTSurfaceTouchHandler.mm | 5 + .../react-native/React/Modules/RCTUIManager.m | 5 +- .../react-native/React/UIUtils/RCTUIUtils.m | 16 +- .../React/Views/RCTModalHostViewController.m | 6 +- .../react-native/React/Views/RCTViewManager.h | 19 + .../React/Views/RCTWrapperViewController.m | 3 + .../React/Views/ScrollView/RCTScrollView.m | 2 + .../Views/ScrollView/RCTScrollViewManager.h | 4 + .../Views/ScrollView/RCTScrollViewManager.m | 5 +- .../react/views/image/localCommands.js | 43 ++ .../ios/ReactCommon/RCTSampleTurboModule.mm | 14 +- .../renderer/graphics/React-graphics.podspec | 2 + .../react-native/local-cli/localCommands.js | 45 ++ packages/react-native/package.json | 7 +- packages/react-native/react-native.config.js | 14 +- .../react-native/scripts/cocoapods/helpers.rb | 4 + .../codegen/generate-artifacts-executor.js | 2 +- .../scripts/react-native-xcode.sh | 1 + .../react-native/scripts/react_native_pods.rb | 10 +- .../sdks/hermes-engine/hermes-engine.podspec | 6 +- .../utils/build-hermesc-xcode.sh | 15 + packages/react-native/template/App.tsx | 93 +++ .../react-native/template/metro.config.js | 20 + packages/react-native/template/package.json | 39 + .../HelloWorld.xcodeproj/project.pbxproj | 691 ++++++++++++++++++ .../xcschemes/HelloWorld.xcscheme | 88 +++ .../template/visionos/HelloWorld/App.swift | 12 + .../visionos/HelloWorld/AppDelegate.swift | 17 + .../AppIcon.appiconset/Contents.json | 53 ++ .../HelloWorld/Images.xcassets/Contents.json | 6 + .../template/visionos/HelloWorld/Info.plist | 57 ++ .../HelloWorldTests/HelloWorldTests.m | 66 ++ .../visionos/HelloWorldTests/Info.plist | 24 + .../react-native/template/visionos/Podfile | 40 + .../react-native/template/visionos/_xcode.env | 11 + .../third-party-podspecs/SocketRocket.podspec | 21 + packages/react-native/types/tsconfig.json | 27 +- packages/rn-tester/Podfile | 7 +- packages/rn-tester/Podfile.lock | 85 ++- .../rn-tester/RNTester-visionOS/App.swift | 12 + .../RNTester-visionOS/AppDelegate.swift | 13 + .../Content.imageset/Contents.json | 13 + .../Content.imageset/back.jpg | Bin 0 -> 29302 bytes .../Back.solidimagestacklayer/Contents.json | 6 + .../AppIcon.solidimagestack/Contents.json | 17 + .../Content.imageset/Contents.json | 13 + .../Content.imageset/front.png | Bin 0 -> 131459 bytes .../Front.solidimagestacklayer/Contents.json | 6 + .../Content.imageset/Contents.json | 12 + .../Middle.solidimagestacklayer/Contents.json | 6 + .../Assets.xcassets/Contents.json | 6 + .../rn-tester/RNTester-visionOS/Info.plist | 15 + .../Preview Assets.xcassets/Contents.json | 6 + packages/rn-tester/RNTester/AppDelegate.mm | 2 + .../RNTesterPods.xcodeproj/project.pbxproj | 456 +++++++++++- packages/rn-tester/metro.config.js | 4 + packages/rn-tester/package.json | 6 +- scripts/build/config.js | 4 + scripts/e2e/verdaccio.yml | 4 + scripts/oot-release.js | 151 ++++ yarn.lock | 2 +- 117 files changed, 3049 insertions(+), 258 deletions(-) create mode 100644 packages/out-of-tree-platforms/.gitignore create mode 100644 packages/out-of-tree-platforms/README.md create mode 100644 packages/out-of-tree-platforms/index.js.flow create mode 100644 packages/out-of-tree-platforms/package.json create mode 100644 packages/out-of-tree-platforms/src/getPlatformResolver.js create mode 100644 packages/out-of-tree-platforms/src/index.js create mode 100644 packages/react-native/Libraries/SwiftExtensions/RCTMainWindow.swift create mode 100644 packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.h create mode 100644 packages/react-native/Libraries/SwiftExtensions/RCTReactViewController.m create mode 100644 packages/react-native/Libraries/SwiftExtensions/RCTRootViewRepresentable.swift create mode 100644 packages/react-native/Libraries/SwiftExtensions/React-RCTSwiftExtensions.podspec create mode 100644 packages/react-native/Libraries/WindowManager/React-RCTWindowManager.podspec create mode 100644 packages/react-native/Libraries/XR/React-RCTXR.podspec create mode 100644 packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/image/localCommands.js create mode 100644 packages/react-native/local-cli/localCommands.js create mode 100644 packages/react-native/template/App.tsx create mode 100644 packages/react-native/template/metro.config.js create mode 100644 packages/react-native/template/package.json create mode 100644 packages/react-native/template/visionos/HelloWorld.xcodeproj/project.pbxproj create mode 100644 packages/react-native/template/visionos/HelloWorld.xcodeproj/xcshareddata/xcschemes/HelloWorld.xcscheme create mode 100644 packages/react-native/template/visionos/HelloWorld/App.swift create mode 100644 packages/react-native/template/visionos/HelloWorld/AppDelegate.swift create mode 100644 packages/react-native/template/visionos/HelloWorld/Images.xcassets/AppIcon.appiconset/Contents.json create mode 100644 packages/react-native/template/visionos/HelloWorld/Images.xcassets/Contents.json create mode 100644 packages/react-native/template/visionos/HelloWorld/Info.plist create mode 100644 packages/react-native/template/visionos/HelloWorldTests/HelloWorldTests.m create mode 100644 packages/react-native/template/visionos/HelloWorldTests/Info.plist create mode 100644 packages/react-native/template/visionos/Podfile create mode 100644 packages/react-native/template/visionos/_xcode.env create mode 100644 packages/react-native/third-party-podspecs/SocketRocket.podspec create mode 100644 packages/rn-tester/RNTester-visionOS/App.swift create mode 100644 packages/rn-tester/RNTester-visionOS/AppDelegate.swift create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Content.imageset/back.jpg create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Back.solidimagestacklayer/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Content.imageset/front.png create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Front.solidimagestacklayer/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Content.imageset/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/AppIcon.solidimagestack/Middle.solidimagestacklayer/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Assets.xcassets/Contents.json create mode 100644 packages/rn-tester/RNTester-visionOS/Info.plist create mode 100644 packages/rn-tester/RNTester-visionOS/Preview Content/Preview Assets.xcassets/Contents.json create mode 100644 scripts/oot-release.js diff --git a/README.md b/README.md index 4d8883c511c666..fe5b8e5e1b2103 100644 --- a/README.md +++ b/README.md @@ -1,147 +1,52 @@

- - React Native + + React Native visionOS

Learn once, write anywhere:
- Build mobile apps with React. + Build spatial apps with React.

-

- - React Native is released under the MIT license. - - - Current CircleCI build status. - - - Current npm package version. - - - PRs welcome! - - - Follow @reactnative - -

- -

- Getting Started - · - Learn the Basics - · - Showcase - · - Contribute - · - Community - · - Support -

- -React Native brings [**React**'s][r] declarative UI framework to iOS and Android. With React Native, you use native UI controls and have full access to the native platform. - -- **Declarative.** React makes it painless to create interactive UIs. Declarative views make your code more predictable and easier to debug. -- **Component-Based.** Build encapsulated components that manage their state, then compose them to make complex UIs. -- **Developer Velocity.** See local changes in seconds. Changes to JavaScript code can be live reloaded without rebuilding the native app. -- **Portability.** Reuse code across iOS, Android, and [other platforms][p]. - -React Native is developed and supported by many companies and individual core contributors. Find out more in our [ecosystem overview][e]. - -[r]: https://react.dev/ -[p]: https://reactnative.dev/docs/out-of-tree-platforms -[e]: https://github.com/facebook/react-native/blob/HEAD/ECOSYSTEM.md - -## Contents - -- [Requirements](#-requirements) -- [Building your first React Native app](#-building-your-first-react-native-app) -- [Documentation](#-documentation) -- [Upgrading](#-upgrading) -- [How to Contribute](#-how-to-contribute) -- [Code of Conduct](#code-of-conduct) -- [License](#-license) - - -## 📋 Requirements - -React Native apps may target iOS 13.4 and Android 6.0 (API 23) or newer. You may use Windows, macOS, or Linux as your development operating system, though building and running iOS apps is limited to macOS. Tools like [Expo](https://expo.dev) can be used to work around this. +React Native visionOS allows you to write visionOS with full support for platform SDK. This is a full fork of the main repository with changes needed to support visionOS. -## 🎉 Building your first React Native app +![Screenshot](https://github.com/callstack/react-native-visionos/assets/52801365/0fcd5e5f-628c-49ef-84ab-d1d4675a011a) -Follow the [Getting Started guide](https://reactnative.dev/docs/getting-started). The recommended way to install React Native depends on your project. Here you can find short guides for the most common scenarios: +## 🎉 Building your first spatial React Native app +Follow the [Getting Started](https://callstack.github.io/react-native-visionos-docs/category/getting-started) guide. If you wish to get started quickly, you can utilize this command: -- [Trying out React Native][hello-world] -- [Creating a New Application][new-app] -- [Adding React Native to an Existing Application][existing] +```sh +npx @callstack/react-native-visionos@latest init YourApp +``` -[hello-world]: https://snack.expo.dev/@samples/hello-world -[new-app]: https://reactnative.dev/docs/getting-started -[existing]: https://reactnative.dev/docs/integration-with-existing-apps ## 📖 Documentation -The full documentation for React Native can be found on our [website][docs]. - -The React Native documentation discusses components, APIs, and topics that are specific to React Native. For further documentation on the React API that is shared between React Native and React DOM, refer to the [React documentation][r-docs]. - -The source for the React Native documentation and website is hosted on a separate repo, [**@facebook/react-native-website**][repo-website]. - -[docs]: https://reactnative.dev/docs/getting-started -[r-docs]: https://react.dev/learn -[repo-website]: https://github.com/facebook/react-native-website - -## 🚀 Upgrading - -Upgrading to new versions of React Native may give you access to more APIs, views, developer tools, and other goodies. See the [Upgrading Guide][u] for instructions. - -React Native releases are discussed [in this discussion repo](https://github.com/reactwg/react-native-releases/discussions). - -[u]: https://reactnative.dev/docs/upgrading -[repo-releases]: https://github.com/react-native-community/react-native-releases - -## 👏 How to Contribute - -The main purpose of this repository is to continue evolving React Native core. We want to make contributing to this project as easy and transparent as possible, and we are grateful to the community for contributing bug fixes and improvements. Read below to learn how you can take part in improving React Native. - -### [Code of Conduct][code] - -Facebook has adopted a Code of Conduct that we expect project participants to adhere to. -Please read the [full text][code] so that you can understand what actions will and will not be tolerated. - -[code]: https://code.fb.com/codeofconduct/ - -### [Contributing Guide][contribute] - -Read our [**Contributing Guide**][contribute] to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to React Native. - -[contribute]: https://reactnative.dev/docs/contributing - -### [Open Source Roadmap][roadmap] - -You can learn more about our vision for React Native in the [**Roadmap**][roadmap]. +The full documentation for React Native visionOS can be found on our [website](https://callstack.github.io/react-native-visionos-docs). -[roadmap]: https://github.com/facebook/react-native/wiki/Roadmap +The source for the React Native visionOS documentation and website is hosted on a separate repo, @callstack/react-native-visionos-docs. -### Good First Issues +## Contributing -We have a list of [good first issues][gfi] that contain bugs which have a relatively limited scope. This is a great place to get started, gain experience, and get familiar with our contribution process. +Prerequisites: +- Download the latest Xcode (at least 15.2) +- Install the latest version of CMake (at least v3.28.0) -[gfi]: https://github.com/facebook/react-native/labels/good%20first%20issue +Check out `rn-tester` [README.md](./packages/rn-tester/README.md) to build React Native from the source. -### Discussions +Remember to use `RNTester-visionOS` target -Larger discussions and proposals are discussed in [**@react-native-community/discussions-and-proposals**][repo-meta]. +If `RNTester-visionOS` scheme is not showing up, click "New Scheme", which should be pre-populated with `RNTester-visionOS`. Build the app using Xcode. -[repo-meta]: https://github.com/react-native-community/discussions-and-proposals +## Release process -## 📄 License +We use a script called `oot-release.js` which automatically releases `visionos` packages and aligns versions of dependencies with React Native core. -React Native is MIT licensed, as found in the [LICENSE][l] file. +Usage: -React Native documentation is Creative Commons licensed, as found in the [LICENSE-docs][ld] file. +```sh +node ./scripts/oot-release.js --new-version "" --react-native-version "" --one-time-password "" +``` -[l]: https://github.com/facebook/react-native/blob/main/LICENSE -[ld]: https://github.com/facebook/react-native/blob/main/LICENSE-docs +To test releases and template we use [Verdaccio](https://verdaccio.org/). diff --git a/jest.config.js b/jest.config.js index f81a4049d9a5d2..9d3ca151f96dfc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -40,6 +40,15 @@ module.exports = { defaultPlatform: 'ios', platforms: ['ios', 'android'], }, + moduleNameMapper: { + // These mappers allow out-of-tree platforms tests to seamlessly resolve RN imports + '^react-native/(.*)': '/packages/react-native/$1', + '^react-native$': '/packages/react-native/index.js', + // This module is internal to Meta and used by their custom React renderer. + // In tests, we can just use a mock. + '^ReactNativeInternalFeatureFlags$': + '/packages/react-native/jest/ReactNativeInternalFeatureFlagsMock.js', + }, moduleFileExtensions: ['fb.js'].concat(defaults.moduleFileExtensions), modulePathIgnorePatterns: ['scripts/.*/__fixtures__/'], unmockedModulePathPatterns: [ diff --git a/packages/out-of-tree-platforms/.gitignore b/packages/out-of-tree-platforms/.gitignore new file mode 100644 index 00000000000000..ac0720f94136cd --- /dev/null +++ b/packages/out-of-tree-platforms/.gitignore @@ -0,0 +1,2 @@ +# Build output +/dist \ No newline at end of file diff --git a/packages/out-of-tree-platforms/README.md b/packages/out-of-tree-platforms/README.md new file mode 100644 index 00000000000000..972663edaca00e --- /dev/null +++ b/packages/out-of-tree-platforms/README.md @@ -0,0 +1,19 @@ +# @callstack/out-of-tree-platforms + +[![Version][version-badge]][package] + +Utilities for Out of Tree (OOT) platforms. + +## `getPlatformResolver` + +```js +getPlatformResolver(options: ResolverConfig): CustomResolver +``` + +### options + +```js +type ResolverConfig = { + platformImplementations: {[platform: string]: string}, +}; +``` diff --git a/packages/out-of-tree-platforms/index.js.flow b/packages/out-of-tree-platforms/index.js.flow new file mode 100644 index 00000000000000..8420b1093fdb2f --- /dev/null +++ b/packages/out-of-tree-platforms/index.js.flow @@ -0,0 +1 @@ +export * from './src'; diff --git a/packages/out-of-tree-platforms/package.json b/packages/out-of-tree-platforms/package.json new file mode 100644 index 00000000000000..ee09627611fd41 --- /dev/null +++ b/packages/out-of-tree-platforms/package.json @@ -0,0 +1,27 @@ +{ + "name": "@callstack/out-of-tree-platforms", + "version": "0.75.0-main", + "description": "Utils for React Native out of tree platforms.", + "keywords": ["out-of-tree", "react-native"], + "homepage": "https://github.com/callstack/react-native-visionos/tree/HEAD/packages/out-of-tree-platforms#readme", + "bugs": "https://github.com/callstack/react-native-visionos/issues", + "repository": { + "type": "git", + "url": "https://github.com/callstack/react-native-visionos.git", + "directory": "packages/out-of-tree-platforms" + }, + "license": "MIT", + "exports": { + ".": "./src/index.js", + "./package.json": "./package.json" + }, + "files": [ + "dist" + ], + "devDependencies": { + "metro-resolver": "^0.80.0" + }, + "engines": { + "node": ">=18" + } +} diff --git a/packages/out-of-tree-platforms/src/getPlatformResolver.js b/packages/out-of-tree-platforms/src/getPlatformResolver.js new file mode 100644 index 00000000000000..70e3acde5c1d78 --- /dev/null +++ b/packages/out-of-tree-platforms/src/getPlatformResolver.js @@ -0,0 +1,43 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow + * @format + */ + +import type {CustomResolver} from 'metro-resolver'; + +type ResolverConfig = { + platformNameMap: {[platform: string]: string}, +}; + +/** + * Creates a custom Metro resolver that maps platform extensions to package names. + * To be used in app's `metro.config.js` as `resolver.resolveRequest`. + */ +export const getPlatformResolver = (config: ResolverConfig): CustomResolver => { + return (context, moduleName, platform) => { + // `customResolverOptions` is populated through `?resolver.platformExtension` query params + // in the jsBundleURLForBundleRoot method of the react-native/React/Base/RCTBundleURLProvider.mm + const platformExtension = context.customResolverOptions?.platformExtension; + let modifiedModuleName = moduleName; + if ( + typeof platformExtension === 'string' && + config.platformNameMap?.[platformExtension] + ) { + const packageName = config.platformNameMap[platformExtension]; + if (moduleName === 'react-native') { + modifiedModuleName = packageName; + } else if (moduleName.startsWith('react-native/')) { + modifiedModuleName = `${packageName}/${modifiedModuleName.slice( + 'react-native/'.length, + )}`; + } + } + + return context.resolveRequest(context, modifiedModuleName, platform); + }; +}; diff --git a/packages/out-of-tree-platforms/src/index.js b/packages/out-of-tree-platforms/src/index.js new file mode 100644 index 00000000000000..2244b1ce77d29e --- /dev/null +++ b/packages/out-of-tree-platforms/src/index.js @@ -0,0 +1,5 @@ +if (!process.env.BUILD_EXCLUDE_BABEL_REGISTER) { + require('../../../scripts/build/babel-register').registerForMonorepo(); +} + +export * from './getPlatformResolver'; diff --git a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm index 1748b07f17fd3f..c0f0a926126d0f 100644 --- a/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm +++ b/packages/react-native/Libraries/AppDelegate/RCTAppDelegate.mm @@ -18,6 +18,7 @@ #import #import "RCTAppDelegate+Protected.h" #import "RCTAppSetupUtils.h" +#import #if RN_DISABLE_OSS_PLUGIN_HEADER #import @@ -48,10 +49,6 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:( self.rootViewFactory = [self createRCTRootViewFactory]; - UIView *rootView = [self.rootViewFactory viewWithModuleName:self.moduleName - initialProperties:self.initialProps - launchOptions:launchOptions]; - if (self.newArchEnabled || self.fabricEnabled) { [RCTComponentViewFactory currentComponentViewFactory].thirdPartyFabricComponentsProvider = self; } diff --git a/packages/react-native/Libraries/Components/Keyboard/Keyboard.js b/packages/react-native/Libraries/Components/Keyboard/Keyboard.js index 8aae204e97f328..fd23d472e95a57 100644 --- a/packages/react-native/Libraries/Components/Keyboard/Keyboard.js +++ b/packages/react-native/Libraries/Components/Keyboard/Keyboard.js @@ -15,6 +15,7 @@ import LayoutAnimation from '../../LayoutAnimation/LayoutAnimation'; import dismissKeyboard from '../../Utilities/dismissKeyboard'; import Platform from '../../Utilities/Platform'; import NativeKeyboardObserver from './NativeKeyboardObserver'; +import warnOnce from '../../Utilities/warnOnce'; export type KeyboardEventName = $Keys; @@ -114,6 +115,10 @@ class Keyboard { ); constructor() { + if (Platform.isVision) { + return; + } + this.addListener('keyboardDidShow', ev => { this._currentlyShowing = ev; }); @@ -151,6 +156,14 @@ class Keyboard { listener: (...$ElementType) => mixed, context?: mixed, ): EventSubscription { + if (Platform.isVision) { + warnOnce( + 'Keyboard-unavailable', + 'Keyboard API is not available on visionOS platform. The system displays the keyboard in a separate window, leaving the app’s window unaffected by the keyboard’s appearance and disappearance', + ); + return {remove() {}}; + } + return this._emitter.addListener(eventType, listener); } @@ -160,6 +173,10 @@ class Keyboard { * @param {string} eventType The native event string listeners are watching which will be removed. */ removeAllListeners>(eventType: ?K): void { + if (Platform.isVision) { + return; + } + this._emitter.removeAllListeners(eventType); } diff --git a/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js b/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js index e26d6771c47209..efea2b6683f40f 100644 --- a/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js +++ b/packages/react-native/Libraries/Components/Keyboard/KeyboardAvoidingView.js @@ -24,6 +24,7 @@ import AccessibilityInfo from '../AccessibilityInfo/AccessibilityInfo'; import View from '../View/View'; import Keyboard from './Keyboard'; import * as React from 'react'; +import warnOnce from '../../Utilities/warnOnce'; type Props = $ReadOnly<{| ...ViewProps, @@ -176,6 +177,13 @@ class KeyboardAvoidingView extends React.Component { componentDidMount(): void { if (Platform.OS === 'ios') { + if (Platform.isVision) { + warnOnce( + 'KeyboardAvoidingView-unavailable', + 'KeyboardAvoidingView is not available on visionOS platform. The system displays the keyboard in a separate window, leaving the app’s window unaffected by the keyboard’s appearance and disappearance', + ); + return; + } this._subscriptions = [ Keyboard.addListener('keyboardWillChangeFrame', this._onKeyboardChange), ]; @@ -205,6 +213,16 @@ class KeyboardAvoidingView extends React.Component { onLayout, ...props } = this.props; + + if (Platform.isVision) { + // KeyboardAvoidingView is not supported on VisionOS, so we return a simple View without the onLayout handler + return ( + + {children} + + ); + } + const bottomHeight = enabled === true ? this.state.bottom : 0; switch (behavior) { case 'height': diff --git a/packages/react-native/Libraries/Components/Pressable/Pressable.js b/packages/react-native/Libraries/Components/Pressable/Pressable.js index bd0d6a43a3a666..8b4bc667bdbf38 100644 --- a/packages/react-native/Libraries/Components/Pressable/Pressable.js +++ b/packages/react-native/Libraries/Components/Pressable/Pressable.js @@ -24,6 +24,7 @@ import type { import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import usePressability from '../../Pressability/usePressability'; import {type RectOrSize} from '../../StyleSheet/Rect'; +import StyleSheet from '../../StyleSheet/StyleSheet'; import useMergeRefs from '../../Utilities/useMergeRefs'; import View from '../View/View'; import useAndroidRippleForView, { @@ -347,7 +348,10 @@ function Pressable( {...restPropsWithDefaults} {...eventHandlers} ref={mergedRef} - style={typeof style === 'function' ? style({pressed}) : style} + style={[ + styles.pressable, + typeof style === 'function' ? style({pressed}) : style, + ]} collapsable={false}> {typeof children === 'function' ? children({pressed}) : children} {__DEV__ ? : null} @@ -355,6 +359,12 @@ function Pressable( ); } +const styles = StyleSheet.create({ + pressable: { + cursor: 'pointer', + }, +}); + function usePressState(forcePressed: boolean): [boolean, (boolean) => void] { const [pressed, setPressed] = useState(false); return [pressed || forcePressed, setPressed]; diff --git a/packages/react-native/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap b/packages/react-native/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap index 307aaba80c6af8..9fddf3ccb102dc 100644 --- a/packages/react-native/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap +++ b/packages/react-native/Libraries/Components/Pressable/__tests__/__snapshots__/Pressable-test.js.snap @@ -31,6 +31,14 @@ exports[` should render as expected: should deep render when mocked onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -67,6 +75,14 @@ exports[` should render as expected: should deep render when not mo onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -103,6 +119,14 @@ exports[` should be disabled when disabled is true: onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -139,6 +163,14 @@ exports[` should be disabled when disabled is true: onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -175,6 +207,14 @@ exports[` should be disable onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -211,6 +251,14 @@ exports[` should be disable onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -247,6 +295,14 @@ exports[` shou onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -283,6 +339,14 @@ exports[` shou onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -319,6 +383,14 @@ exports[` sh onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -355,6 +427,14 @@ exports[` sh onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > diff --git a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js index 2a6dd0ff4e8ca6..f4d0b66c9512fe 100644 --- a/packages/react-native/Libraries/Components/ScrollView/ScrollView.js +++ b/packages/react-native/Libraries/Components/ScrollView/ScrollView.js @@ -766,22 +766,24 @@ class ScrollView extends React.Component { this._keyboardMetrics = Keyboard.metrics(); this._additionalScrollOffset = 0; - this._subscriptionKeyboardWillShow = Keyboard.addListener( - 'keyboardWillShow', - this.scrollResponderKeyboardWillShow, - ); - this._subscriptionKeyboardWillHide = Keyboard.addListener( - 'keyboardWillHide', - this.scrollResponderKeyboardWillHide, - ); - this._subscriptionKeyboardDidShow = Keyboard.addListener( - 'keyboardDidShow', - this.scrollResponderKeyboardDidShow, - ); - this._subscriptionKeyboardDidHide = Keyboard.addListener( - 'keyboardDidHide', - this.scrollResponderKeyboardDidHide, - ); + if (Platform.isVision) { + this._subscriptionKeyboardWillShow = Keyboard.addListener( + 'keyboardWillShow', + this.scrollResponderKeyboardWillShow, + ); + this._subscriptionKeyboardWillHide = Keyboard.addListener( + 'keyboardWillHide', + this.scrollResponderKeyboardWillHide, + ); + this._subscriptionKeyboardDidShow = Keyboard.addListener( + 'keyboardDidShow', + this.scrollResponderKeyboardDidShow, + ); + this._subscriptionKeyboardDidHide = Keyboard.addListener( + 'keyboardDidHide', + this.scrollResponderKeyboardDidHide, + ); + } this._updateAnimatedNodeAttachment(); } diff --git a/packages/react-native/Libraries/Components/StatusBar/StatusBar.js b/packages/react-native/Libraries/Components/StatusBar/StatusBar.js index 20c2cf49d9fe69..a533c7d63acdbd 100644 --- a/packages/react-native/Libraries/Components/StatusBar/StatusBar.js +++ b/packages/react-native/Libraries/Components/StatusBar/StatusBar.js @@ -12,6 +12,7 @@ import type {ColorValue} from '../../StyleSheet/StyleSheet'; import processColor from '../../StyleSheet/processColor'; import Platform from '../../Utilities/Platform'; +import warnOnce from '../../Utilities/warnOnce'; import NativeStatusBarManagerAndroid from './NativeStatusBarManagerAndroid'; import NativeStatusBarManagerIOS from './NativeStatusBarManagerIOS'; import invariant from 'invariant'; @@ -373,6 +374,13 @@ class StatusBar extends React.Component { _stackEntry = null; componentDidMount() { + if (Platform.isVision) { + warnOnce( + 'StatusBar-unavailable', + 'StatusBar is not available on visionOS platform.', + ); + return; + } // Every time a StatusBar component is mounted, we push it's prop to a stack // and always update the native status bar with the props from the top of then // stack. This allows having multiple StatusBar components and the one that is diff --git a/packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js b/packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js index 89b438e54944ef..5250b0615f9d15 100644 --- a/packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js +++ b/packages/react-native/Libraries/Components/TextInput/InputAccessoryView.js @@ -90,7 +90,7 @@ type Props = $ReadOnly<{| const InputAccessoryView: React.AbstractComponent = (props: Props) => { const {width} = useWindowDimensions(); - if (Platform.OS === 'ios') { + if (Platform.OS === 'ios' && !Platform.isVision) { if (React.Children.count(props.children) === 0) { return null; } diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js index 61e9f210110a1d..dcc133af3e8d6c 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableHighlight.js @@ -329,10 +329,13 @@ class TouchableHighlight extends React.Component { accessibilityElementsHidden={ this.props['aria-hidden'] ?? this.props.accessibilityElementsHidden } - style={StyleSheet.compose( - this.props.style, - this.state.extraStyles?.underlay, - )} + style={[ + styles.touchable, + StyleSheet.compose( + this.props.style, + this.state.extraStyles?.underlay, + ), + ]} onLayout={this.props.onLayout} hitSlop={this.props.hitSlop} hasTVPreferredFocus={this.props.hasTVPreferredFocus} @@ -381,6 +384,12 @@ class TouchableHighlight extends React.Component { } } +const styles = StyleSheet.create({ + touchable: { + cursor: 'pointer', + }, +}); + const Touchable: React.AbstractComponent< $ReadOnly<$Diff|}>>, React.ElementRef, diff --git a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js index 14ca87aba403cd..1d75cafe5be266 100644 --- a/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js +++ b/packages/react-native/Libraries/Components/Touchable/TouchableOpacity.js @@ -18,6 +18,7 @@ import Pressability, { } from '../../Pressability/Pressability'; import {PressabilityDebugView} from '../../Pressability/PressabilityDebug'; import flattenStyle from '../../StyleSheet/flattenStyle'; +import StyleSheet from '../../StyleSheet/StyleSheet'; import Platform from '../../Utilities/Platform'; import * as React from 'react'; @@ -275,7 +276,7 @@ class TouchableOpacity extends React.Component { accessibilityElementsHidden={ this.props['aria-hidden'] ?? this.props.accessibilityElementsHidden } - style={[this.props.style, {opacity: this.state.anim}]} + style={[styles.touchable, this.props.style, {opacity: this.state.anim}]} nativeID={this.props.id ?? this.props.nativeID} testID={this.props.testID} onLayout={this.props.onLayout} @@ -326,6 +327,12 @@ class TouchableOpacity extends React.Component { } } +const styles = StyleSheet.create({ + touchable: { + cursor: 'pointer', + }, +}); + const Touchable: React.AbstractComponent< Props, React.ElementRef, diff --git a/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap b/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap index 35c845e97493fc..f26560d45d738a 100644 --- a/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap +++ b/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableHighlight-test.js.snap @@ -19,7 +19,14 @@ exports[`TouchableHighlight renders correctly 1`] = ` onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} - style={Object {}} + style={ + Array [ + Object { + "cursor": "pointer", + }, + Object {}, + ] + } > Touchable @@ -51,6 +58,14 @@ exports[`TouchableHighlight with disabled state should be disabled when disabled onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -80,6 +95,14 @@ exports[`TouchableHighlight with disabled state should be disabled when disabled onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -109,6 +132,14 @@ exports[`TouchableHighlight with disabled state should disable button when acces onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -139,6 +170,14 @@ exports[`TouchableHighlight with disabled state should keep accessibilityState w onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > @@ -168,6 +207,14 @@ exports[`TouchableHighlight with disabled state should overwrite accessibilitySt onResponderTerminate={[Function]} onResponderTerminationRequest={[Function]} onStartShouldSetResponder={[Function]} + style={ + Array [ + Object { + "cursor": "pointer", + }, + undefined, + ] + } > diff --git a/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableOpacity-test.js.snap b/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableOpacity-test.js.snap index 17f2e7f6f764e0..ca634909ca5afc 100644 --- a/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableOpacity-test.js.snap +++ b/packages/react-native/Libraries/Components/Touchable/__tests__/__snapshots__/TouchableOpacity-test.js.snap @@ -31,6 +31,7 @@ exports[`TouchableOpacity renders correctly 1`] = ` onStartShouldSetResponder={[Function]} style={ Object { + "cursor": "pointer", "opacity": 1, } } @@ -72,6 +73,7 @@ exports[`TouchableOpacity renders in disabled state when a disabled prop is pass onStartShouldSetResponder={[Function]} style={ Object { + "cursor": "pointer", "opacity": 1, } } @@ -113,6 +115,7 @@ exports[`TouchableOpacity renders in disabled state when a key disabled in acces onStartShouldSetResponder={[Function]} style={ Object { + "cursor": "pointer", "opacity": 1, } } diff --git a/packages/react-native/Libraries/Components/__tests__/__snapshots__/Button-test.js.snap b/packages/react-native/Libraries/Components/__tests__/__snapshots__/Button-test.js.snap index 5b4294e0e8c850..a3efb80e477bfc 100644 --- a/packages/react-native/Libraries/Components/__tests__/__snapshots__/Button-test.js.snap +++ b/packages/react-native/Libraries/Components/__tests__/__snapshots__/Button-test.js.snap @@ -32,6 +32,7 @@ exports[`