question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Modal does not appear

See original GitHub issue

I am trying to get a simple modal to appear on screen using RN v0.40.0. I have imported the animated modal using

import Modal from 'react-native-animated-modal';

and have inserted a modal component into my view:

 <View>
              <Text style={{marginTop: 80}}>Hello</Text>
               
               <Modal
                isVisible={true}
               >
               <Navigator
                initialRoute={{ title: 'SignUp', index: 0 }}
                renderScene={(route, navigator) =>
                  <SignUp onModalClose={this.onModalClose.bind(this)} />
                }
                />
               </Modal>
</View>

The modal does not appear.

However, I have found that by changing isVisible to the regular react-native prop visible and running my app, a normal non animating modal appears. After that, I can change the visibleProp back to the animatedModal prop isVisible, and get an animated modal to appear the first time running the app, but it does not appear on subsequent runs.

For example, I change isVisible to visible:

<Modal
                visible={true}
               >

Then run the app. A regular react native modal appears with my views in it.

After that, I change visible back to isVisible

<Modal
                isVisible={true}
               >

and run the app again. this time the animated modal appears correctly this one and only run. However if I refresh the app in the simulator, the modal does not appear on subsequent runs. Any ideas how to solve this?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
akshaysanthanamcommented, Dec 27, 2018

The modal does not appear for at all, i have tried the code is “A complete example section”:

Code: import React, { Component } from “react”; import { Text, TouchableOpacity, View } from “react-native”; import Modal from “react-native-modal”;

export default class ModalTester extends Component { state = { isModalVisible: false };

_toggleModal = () =>
    this.setState({ isModalVisible: !this.state.isModalVisible });

render() {
    return (
        <View style={{ flex: 1 }}>
            <TouchableOpacity onPress={this._toggleModal}>
                <Text>Show Modal</Text>
            </TouchableOpacity>
            <Modal isVisible={this.state.isModalVisible}>
                <View style={{ flex: 1 }}>
                    <Text>Hello!</Text>
                    <TouchableOpacity onPress={this._toggleModal}>
                        <Text>Hide me!</Text>
                    </TouchableOpacity>
                </View>
            </Modal>
        </View>
    );
}

}

The modal does not show-up at all.

0reactions
sayo96commented, Dec 17, 2020

I’m experiencing the same problem. In my case, modal doesn’t appear after a re render but it appears when i reload the app. @mmazzarolo @akshaysanthanam @helloeyesimple Do any of you guys have a fix for this problem?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bootstrap modal not displaying - Stack Overflow
to check, Go to your modal fade class on browser and then check if there is any custom file comes on top. such...
Read more >
Modal not showing 5.7 - Bug Reports - Bootstrap Studio Forum
I make a button to open the modal when i click the button modal not showing on preview . The only way i...
Read more >
Modal - Bootstrap
Use Bootstrap's JavaScript modal plugin to add dialogs to your site for lightboxes, user notifications, or completely custom content.
Read more >
Modal not showing when used with Bootstrap V4 #280 - GitHub
I spent some time wondering why the modal would not show on screen, now I found out ... Modal not showing when used...
Read more >
Modal is not showing (only backdrop is showing) - MDBootstrap
Topic: Modal is not showing (only backdrop is showing) ... Actual behavior modal.show() set only backdrop and no modal added.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found