Modal gets stuck visible when rendered in Storybook on iOS
See original GitHub issue(works fine with default RN modal)
Environment
System:
OS: macOS 11.4
CPU: (16) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 25.61 MB / 16.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node
Yarn: 1.22.10 - ~/.nvm/versions/node/v14.16.0/bin/yarn
npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm
Watchman: 2021.06.07.00 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /Users/brian/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: iOS 14.5, DriverKit 20.4, macOS 11.3, tvOS 14.5, watchOS 7.4
Android SDK:
API Levels: 23, 28, 29, 30
Build Tools: 29.0.2, 30.0.3
System Images: android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.2 AI-202.7660.26.42.7351085
Xcode: 12.5.1/12E507 - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_292 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.2 => 0.64.2
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Platforms
iOS
Versions
- iOS: 14.5
- react-native-modal: 12.0.2
- react-native: 0.65.2
- react: 17.0.1
Description
This seems similar to an issue I’ve had with this library (and the RN Modal for years now) - It seems like it can often cause soft locks, especially when other native views are involved. BUT, I don’t think that is the case here. I’m not totally sure what storybook does under the hood, but seems to break this and not the Modal component in react native
Reproducible Demo
I will see if I can get to this 😃
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
StoryBook: how to test modal views? - react native
This works OK for "regular" views, but when I display a modal view (implemented using react-native-modal ), I get "locked in", i.e. the...
Read more >Page stops rendering until click() is called : r/angular - Reddit
I want each element to be clickable hence the click() and on the click a modal is opened. Problem is the rest of...
Read more >How to Create a Modal Route with React Router - Morioh
Building a modal module for react with react-router. First, go ahead and install react-router-dom through npm. At the very top level of your...
Read more >A Story of a React Re-Rendering Bug - Engineering Blog
The input field is a text input, and event handlers for focus and blur events. · When it gets focused, it will trigger...
Read more >Visual testing for React and Storybook - Applitools
One of them is to develop a demo or showcase application. You can use the showcase app to render components and make sure...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For anyone else who is still facing this issue I was able to workaround this in stories using
key
prop with isVisible state as value<Modal isVisible={modalShown} key={modalShown}>{content}</Modal
Its just triggers additional rerender while changing visibility. Seems that this disables optimizations that lib uses under the hood. Also it’s disables animations too. So don’t use it directly inside your components, use it in stories instead.