Can you please explain this error

error: User validation failed: email: Cast to string failed for value “[ ‘test266@test.com’ ]” at path “email”, username: Cast to string failed for value “[ ‘test266’ ]” at path “username”, password: Cast to string failed for value “[ ‘test266’ ]” at path “password”"

i am working MERN stack app when i signup the user i got this error .

that was my mistake i was getting my data from react form as an array.

BEFORE

 handleChange = e => {
        this.setState({
            [e.target.name]: [e.target.value]
        })
    };

AFTER

 handleChange = e => {
        this.setState({
            [e.target.name]: e.target.value    <--- just change here
        })
    };