[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?

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠