Open mrchief opened 7 years ago
const { status: { accounts: { status, error } = {} } = {} } = this.props
gives me:
status: "SUCCESS|ERROR" string error: instance of Status class
status: "SUCCESS|ERROR"
error: instance of Status class
On console, I can drill into error and print out error.response.body which is a JS object containing a detailed error object.
error.response.body
However, if I pass error to a react component, it becomes a boolean
error
<ErrorCard error={error} /> const ErrorCard = (error: any) => { console.log(error) const { response: { body: { title, description } = {} } = {} } = error return ( <div className={styles.errorCard}> <div className={styles.cardContent}> <h4 className={styles.header}>{title}</h4> <p>{description}</p> </div> </div> ) }
renders error: true on the console log and of course, the title, description etc are missing.
error: true
What am I missing here?
gives me:
status: "SUCCESS|ERROR"
stringerror: instance of Status class
On console, I can drill into error and print out
error.response.body
which is a JS object containing a detailed error object.However, if I pass
error
to a react component, it becomes a booleanrenders
error: true
on the console log and of course, the title, description etc are missing.What am I missing here?