简体   繁体   中英

How to make Alert work on android/emulator? (react-native)

my package.json

Trying to run on expo cli with expo start -c. Usual alert() works, but not Alert from react-native

{ "name": "my-app", "version": "0.1.0", "private": true, "dependencies": { "@testing-library/jest-dom": "^4.2.4", "@testing-library/react": "^9.4.1", "@testing-library/user-event": "^7.2.1", "axios": "^0.19.2", "json-server": "^0.16.1", "react": "^16.12.0", "react-dom": "^16.12.0", "react-scripts": "3.4.0" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", "server": "json-server -p3001 db.json" }, "eslintConfig": { "extends": "react-app" }, "browserslist": { "production": [ ">0.2%", "not dead", "not op_mini all" ], "development": [ "last 1 chrome version", "last 1 firefox version", "last 1 safari version" ] }}

You need to provide more details about the issue. I tried an example of alert example given in below mentioned url, in an app created from expo and it worked. https://reactnative.dev/docs/alert

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM