GeekyAnts / NativeBase

Mobile-first, accessible components for React Native & Web to build consistent UI across Android, iOS and Web.
https://nativebase.io/
MIT License
20.19k stars 2.38k forks source link

react-app, Modal not show #4999

Open thuantvDr4 opened 2 years ago

thuantvDr4 commented 2 years ago

Description

Modal not show on react app

CodeSandbox/Snack link

none

Steps to reproduce

No response

NativeBase Version

3.4.4

Platform

Other Platform

No response

Additional Information

import React, {useState} from "react"; import {Box, Button, FormControl, Input, Modal} from "native-base";

const TestModal =()=> { const [showModal, setShowModal] = useState(false); return <Button shadow={2} onPress={() => setShowModal(true)}> Button ... <Modal isOpen={showModal} onClose={() => setShowModal(false)}>

Contact Us Name Email ; } export default TestModal;
mayank-96 commented 2 years ago

Hello @thuantvDr4, sorry but I'm not able to reproduce your issue, can you please create a codeSandBox/snack link.

thuantvDr4 commented 2 years ago

Hello @thuantvDr4, sorry but I'm not able to reproduce your issue, can you please create a codeSandBox/snack link.

I copied that code and paste on codeSandBox, It worked, modal showed when click button. But, when I run on localhost:3000, it is not work. It's magic!

Viraj-10 commented 2 years ago

Hi @thuantvDr4, Can you push small code into the GitHub repo from there we can clone it and then try to reproduce it in our local machine. also please provide the information mentioned in the checklist below.

uit2712 commented 2 years ago

I have same this problem when I run on my localhost:3000 for React app, but it works when I deploy code to Netlify. I use code in your library example, but it doesn't work

Please check this problem. Thank you in advanced

jontewks commented 2 years ago

Just ran into this as well, thanks for that last comment about deployed code working. I'm using nextjs and when I do yarn dev I also cannot get a modal to show, but when I run the build and serve the built files, it works normally.

Alpacora commented 2 years ago

Fellas try to remove React.StrictMode from your index file, probably will resolve but this is a bug....

JosefBud commented 1 year ago

Fellas try to remove React.StrictMode from your index file, probably will resolve but this is a bug....

This fixed it. Thank you!