mirror of
				https://github.com/elyby/accounts-frontend.git
				synced 2025-05-31 14:11:58 +05:30 
			
		
		
		
	* 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
This commit is contained in:
		@@ -15,18 +15,8 @@ export default class FormInputComponent<P, S = {}> 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 <FormError error={error} />;
 | 
			
		||||
        return <FormError error={this.state?.error || this.props.error} />;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    setError(error: Error) {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user