UNPKG

lynx-form-x

Version:

LynxFormX is a lightweight and intuitive form library built for the Lynx framework for mobile development. It streamlines form management by automatically binding fields, handling validation, and providing easy-to-use hooks for custom field manipulation—a

7 lines (6 loc) • 265 B
import { useContext } from '@lynx-js/react'; import { formContext } from './Form.jsx'; export const Error = ({ name, children, ...props }) => { const errors = useContext(formContext).errors; return errors[name] && <text {...props}>{errors[name]}</text>; };