From 4ef8d6462d9285a005ec04dc8d5f9ed39a9a9788 Mon Sep 17 00:00:00 2001 From: cenx Date: Thu, 13 Oct 2022 14:55:42 +0800 Subject: [PATCH] Update index.js fix android crash, when testID is number --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 5152dcd..2db0f2a 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ import { Platform } from 'react-native' export default function testID(id) { + id = typeof id !== 'string' ? id + '' : id; // fix android crash, when id is number return Platform.OS === 'android' ? { accessible: true, accessibilityLabel: id } : { testID: id }