botpress

How to get json object in botpress custom component?

≡放荡痞女 提交于 2020-01-02 08:56:30
问题 I am calling an api from botpress which returns a list of objects which I need to display in my custom component, but I always get it as string InfaLinkPreview.jsx: "[object Object]" if I use console.log(JSON.parse(this.contentArray)) I get below exception Uncaught SyntaxError: Unexpected token o in JSON at position 1 at JSON.parse (<anonymous>) at eval (eval at render (VM449 lite.bundle.js:10992), <anonymous>:1:18) at InfaLinkPreview.render (VM449 lite.bundle.js:10992) at

How to get json object in botpress custom component?

孤街浪徒 提交于 2019-12-05 18:53:15
I am calling an api from botpress which returns a list of objects which I need to display in my custom component, but I always get it as string InfaLinkPreview.jsx: "[object Object]" if I use console.log(JSON.parse(this.contentArray)) I get below exception Uncaught SyntaxError: Unexpected token o in JSON at position 1 at JSON.parse (<anonymous>) at eval (eval at render (VM449 lite.bundle.js:10992), <anonymous>:1:18) at InfaLinkPreview.render (VM449 lite.bundle.js:10992) at finishClassComponent (react-dom.development.js:14741) at updateClassComponent (react-dom.development.js:14696) at