我想将一个.test()方法添加到validationSchema。测试是寻找常见的电子邮件域拼写错误。例如,检查gmail是否拼写为“ gmial”或“ gnail”。
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
I/ample.wmbsende( 6845): Background concurrent copying GC freed 126466(5699KB) AllocSpace objects, 6(184KB) LOS objects, 49% free, 7638KB/14MB, paused 476us total 240.336ms
W/ample.wmbsende( 6845): Reducing the number of considered missed Gc histogram windows from 135 to 100
W/System ( 6845): A resource failed to call release.
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
I/flutter ( 6845): Instance of 'QuerySnapshot'
D/HostConnection( 6845): HostConnection::get() New Host Connection established 0xf163ba70, tid 7580
D/EGL_emulation( 6845): eglMakeCurrent: 0xf1420a00: ver 2 0 (tinfo 0xf176df30)
D/HostConnection( 6845): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_native_sync_v2 ANDROID_EMU_native_sync_v3 ANDROID_EMU_native_sync_v4 ANDROID_EMU_dma_v1 ANDROID_EMU_direct_mem ANDROID_EMU_host_composition_v1 ANDROID_EMU_host_composition_v2 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
D/EGL_emulation( 6845): eglCreateContext: 0xc1a46600: maj 1 min 0 rcv 1
D/EGL_emulation( 6845): eglMakeCurrent: 0xc1a46600: ver 1 0 (tinfo 0xbd76b5d0)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getObject(Ljava/lang/Object;J)Ljava/lang/Object; (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getInt(Ljava/lang/Object;J)I (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putObject(Ljava/lang/Object;JLjava/lang/Object;)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putInt(Ljava/lang/Object;JI)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->putLong(Ljava/lang/Object;JJ)V (greylist,core-platform-api, linking, allowed)
W/ample.wmbsende( 6845): Accessing hidden method Lsun/misc/Unsafe;->getLong(Ljava/lang/Object;J)J (greylist,core-platform-api, linking, allowed)
答案 0 :(得分:0)
在测试中返回布尔结果。
const validationSchema = Yup.object({
email: Yup.string()
.lowercase()
.email('You have entered an invalid email')
.required('This field is required')
.test('Gmail?', 'Did you mean @gmail?', (value) => value.includes('gmial' || 'gnail')),
});