async componentDidMount() { try { let attachmentURL; const data = await this.getNote(); const note = data.Item; const { content, attachment } = note; if (attachment) { attachmentURL = await Storage.vault.get(attachment); } this.setState({ note, content, attachmentURL }); } catch (e) { console.log(e); } }
async componentDidMount() { try { let attachmentURL; const data = await this.getNote(); const note = data.Item; const { content, attachment } = note; if (attachment) { attachmentURL = await Storage.vault.get(attachment); } this.setState({ note, content, attachmentURL }); } catch (e) { console.log(e); } }