UNPKG

@uiw/react-native

Version:
22 lines 492 B
import React, { useContext } from 'react'; import { Context } from '../hooks/context'; import { Text } from 'react-native'; const Tip = ({ v }) => { const { innerMethods: { store = {}, validator } } = useContext(Context); const content = validator.message(v.field, store[v.field], { validate: v?.validate }); return <Text style={{ color: 'red', marginBottom: content && 10, marginTop: content && 10 }}>{content}</Text>; }; export default Tip;