1import React from 'react';
2import { useFormState } from 'react-final-form';
3import { ErrorText } from 'indigo-react';
4import { FORM_ERROR } from 'final-form';
6export default function FormError(props) {
7 const { submitError, errors, dirtySinceLastSubmit } = useFormState({
11 dirtySinceLastSubmit: true,
15 const formError = errors[FORM_ERROR];
16 const showFormError = !!formError;
17 const showSubmitError = !!submitError && !dirtySinceLastSubmit;
19 return showSubmitError || showFormError ? (
20 <ErrorText {...props}>{submitError || formError}</ErrorText>
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list