UNPKG

@platformbuilders/react-native-ui

Version:
16 lines 944 B
import { __rest } from "tslib"; import React from 'react'; import { ErrorText } from './styles'; const warnBoolean = () => // eslint-disable-next-line no-console console.warn(`@platformbuilders/react-native-ui: received a truthy boolean error instead of string, which won't be rendered.`); const FormError = (_a) => { var { id = 'form_error', accessibility, error = '', centered = false, large = false, children } = _a, rest = __rest(_a, ["id", "accessibility", "error", "centered", "large", "children"]); if (error && typeof error === 'boolean') warnBoolean(); return (React.createElement(React.Fragment, null, children, error && typeof error === 'string' ? (React.createElement(ErrorText, Object.assign({ centered: centered, large: large, testID: `error_${id}`, accessibilityLabel: `Erro ${accessibility || error}` }, rest), error)) : null)); }; export default FormError; //# sourceMappingURL=index.js.map