Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【Bug】Modal displays incorrectly if use reanimated #6035

Open
rabbitmouse opened this issue May 20, 2024 · 7 comments
Open

【Bug】Modal displays incorrectly if use reanimated #6035

rabbitmouse opened this issue May 20, 2024 · 7 comments
Labels
Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided

Comments

@rabbitmouse
Copy link

rabbitmouse commented May 20, 2024

Description

Our project uses the new ReactNative architecture. In the release environment, when the page contains both reanimted and modal, the modal display will be abnormal, and the sub-nodes in the modal will be displayed in the upper left corner.

bugvideo.mov

931cef0ee839e509eacbe8a5bf956a6d

Steps to reproduce

  1. cd ModalBugDemo
  2. npm install
  3. npm run prebuild
  4. expo start --clear
  5. open xcode and running as release
  6. First click the Show Modal button, then the modal will be displayed correctly.
  7. Click the animation switch button
  8. Then click the Show Modal button again and the modal will be displayed in the upper left corner

Snack or a link to a repository

https://github.com/rabbitmouse/ModalBugDemo

Reanimated version

3.11.0

React Native version

0.73.6

Platforms

Android, iOS

JavaScript runtime

Hermes

Workflow

React Native

Architecture

Fabric (New Architecture)

Build type

Release app & production bundle

Device

Real device

Device model

iphone12, Galaxy S22

Acknowledgements

Yes

@github-actions github-actions bot added Missing info The user didn't precise the problem enough Repro provided A reproduction with a snippet of code, snack or repo is provided Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS and removed Missing info The user didn't precise the problem enough labels May 20, 2024
@D2cGen
Copy link

D2cGen commented May 20, 2024

same problem, Fatal defect,please fix this as soon as possible

@szydlovsky
Copy link
Contributor

@rabbitmouse Hello, I ran your repro and it worked perfectly for me. Definitely one thing I can suggest you is to run:
npx expo start --clear instead of expo start... But other than that, I ran the exact same repo and didn't see any of the issues.

Screen.Recording.2024-05-21.at.15.13.24.mov

@rabbitmouse
Copy link
Author

rabbitmouse commented May 22, 2024

@rabbitmouse Hello, I ran your repro and it worked perfectly for me. Definitely one thing I can suggest you is to run: npx expo start --clear instead of expo start... But other than that, I ran the exact same repo and didn't see any of the issues.

Screen.Recording.2024-05-21.at.15.13.24.mov

@szydlovsky hi, I think you are running in debug mode. This bug will only exist in release mode.
Please try to run the release environment

iOS: Please modify the running mode in xcode scheme
image

Android: Please refer to the steps below and install apk into your device

cd ModalBugDemo/
npm i
npm run prebuild
npm run release_android
adb install -r 'android/app/build/outputs/apk/release/app-release.apk'

@szydlovsky
Copy link
Contributor

szydlovsky commented May 23, 2024

hey @rabbitmouse, I have created a yarn-based repo using exact same versions (RN 0.73.6, REA 3.6.2, release mode) - and the bug isn't there. Same happens when I use your repro code in the Reanimated Example app - there are no bugs whatsoever. Please take a look at the repo: https://github.com/szydlovsky/modalrepro, there has to be something wrong with your setup then.

(With yarn you have to run: yarn && cd ios && bundle install && bundle exec pod install and then run the project from Xcode)

@rabbitmouse
Copy link
Author

rabbitmouse commented May 24, 2024

hey @rabbitmouse, I have created a yarn-based repo using exact same versions (RN 0.73.6, REA 3.6.2, release mode) - and the bug isn't there. Same happens when I use your repro code in the Reanimated Example app - there are no bugs whatsoever. Please take a look at the repo: https://github.com/szydlovsky/modalrepro, there has to be something wrong with your setup then.

(With yarn you have to run: yarn && cd ios && bundle install && bundle exec pod install and then run the project from Xcode)

Thank you for your reply! @szydlovsky
I noticed that the new react-native architecture was not enabled in your demo.

Modal is normal in the old architecture, but problems will occur in the release environment of the new architecture. Please modify app.json to enable the new architecture.

like this code below

"plugins": [
      "expo-router",
      [
        "expo-build-properties",
        {
          "ios": {
            "newArchEnabled": true,
            "flipper": true
          },
          "android": {
            "newArchEnabled": true
          }
        }
      ],
    ],

@rabbitmouse
Copy link
Author

rabbitmouse commented May 24, 2024

This bug will only appear when the new architecture + release mode.
image

and i use expo to create the demo.

  1. npx create-expo-app StickerSmash --template blank
  2. expo eject
  3. modify app.json and open a new architecture
  4. npm install
  5. Build release mode app

Please refer to my process and try again, thank you very much! 😭 @szydlovsky

@ThienMD
Copy link

ThienMD commented May 28, 2024

Same issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Platform: Android This issue is specific to Android Platform: iOS This issue is specific to iOS Repro provided A reproduction with a snippet of code, snack or repo is provided
Projects
None yet
Development

No branches or pull requests

4 participants