UNPKG

@uiw/react-native

Version:
25 lines 542 B
import React, { useContext } from 'react'; import { Context } from '../hooks/context'; import { View, 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 <View style={{ marginTop: 5 }}> {content && <Text style={{ color: 'red', marginBottom: content && 5 }}>{content}</Text>} </View>; }; export default Tip;