From 4265b37543fba465541e56072f7ba7dc0b97431e Mon Sep 17 00:00:00 2001 From: kotwys <52920928+kotwys@users.noreply.github.com> Date: Wed, 5 Aug 2020 15:58:31 +0400 Subject: [PATCH] Fix field errors view (fixes #23) (#29) * Probably fixes #23 * Track field errors from state only The previous commit has moved error storage to state so it isn't necessary to check for error in props anymore. * Undo state initialization from props --- .../app/components/ui/form/FormInputComponent.tsx | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/app/components/ui/form/FormInputComponent.tsx b/packages/app/components/ui/form/FormInputComponent.tsx index 7126298..6ecb172 100644 --- a/packages/app/components/ui/form/FormInputComponent.tsx +++ b/packages/app/components/ui/form/FormInputComponent.tsx @@ -15,18 +15,8 @@ export default class FormInputComponent
extends FormComponent<
error?: Error;
}
> {
- componentDidUpdate() {
- if (this.state && this.state.error) {
- this.setState({
- error: undefined,
- });
- }
- }
-
renderError() {
- const error = (this.state && this.state.error) || this.props.error;
-
- return