禁止使用警报(no-alert) JavaScript的alert,confirm和prompt功能被广泛认为是刺耳的UI元素,应该由更适合的定制UI实现替换。
(see:1,2,3)eslint:semiwindow.alert('hi') // ✓ okwindow.alert('hi'); // ✗ avoidNeverstartalinewith(
例如: setTimeout("alert('Hi!');",100); 这被认为是一种暗示,eval()因为一串JavaScript代码被传入以进行解释。
显示按钮的最小示例如下所示: <ButtononPress={()=>{Alert.alert('Youtappedthebutton!')}}

扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2026 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059
粤公网安备44030502008569号
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号
