import { FieldContext, ReactiveControllerContext } from '../../../Contexts'; import React, { useContext } from 'react'; export default (): JSX.Element | null => { const context = useContext(FieldContext); const { exceptions } = useContext(ReactiveControllerContext); const error = exceptions ? exceptions[context.name] ?? undefined : undefined; return error ? ( {error[0] ?? ''} ) : null; };