[Custom Views] Actions in Cards, **object type not working.** Only String and Number. (Internat React Error from Amazon)

0

Hello, the situations is:

In our custom view: we have the schema that appear at left side panel (at https://leads-eng.my.connect.aws/views/<viewId>)

Enter image description here

so, we want to add Action buttons with our own action-data and label (following the schema)

Enter image description here

something equivalent to that schema will be

interface Card {
  Summary: ISummary;
  Detail?: IDetails
}

interface ISummary {
  Id: string;
  Heading: string;
  Icon?: string;
  Status?: string;
  Description?: string;
}

interface IDetails {
  Section: string | unknown[];
  Heading?: string | number;
  Description?: string | number;
  Actions?: string[] | number[] | IActionItem[]; // ← here
  Action?: string;
}

interface IActionItem {
  Label: string | number;
  Action?: string | number;
}

When we tried with ActionItem objects, it went to blank screen, and this error appears

Actions: [
      { Label: "Review", Action: `${leadId}` },
      { Label: "Back", Action: `back-action` }
]

Enter image description here

rb_dev
已提问 4 个月前113 查看次数
1 回答
-1

Hi,

I see that you have custom view implemented for your use case and you are getting Minified React error while adding Action buttons with your own action-data and custom label.

As mentioned in the linked react documentation[1], it recommends to have first build your react application locally to debug and track the additional debug information to mitigate this error. If you are not encountering this error on build however, encountering on production then, to investigate this issue you might need to create a support case with premium support[2] with the further details of your react project.

Kindly note that this error could be caused due to many reasons. This issue might happen when rendering is not happening correctly. To further investigate kindly open a support support case with the project folder redacting confidential information along with HAR capture and the debug console logs indicating the issue and we can further guide you better in this.

[1] https://react.dev/errors/31?invariant=31&args%5B%5D=object%20with%20keys%20%7BLabel%2C%20Action%7D

[2] https://docs.aws.amazon.com/awssupport/latest/user/case-management.html

AWS
支持工程师
已回答 4 个月前
profile picture
专家
已审核 2 个月前
  • Thank you for the response, but this isn't an issue with a custom react application. This is an issue with a cards view in a step-by-step guide. Amazon Connect is what is throwing the minified react error when passing an object into actions to support custom Labels. The schema provided by Amazon Connect seems to say this should be supported. Is that not the case?

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则

相关内容