MCPcopy Create free account
hub / github.com/ionic-team/ionic-framework / renderToastMessage

Method renderToastMessage

core/src/components/toast/toast.tsx:660–679  ·  view source on GitHub ↗

* Render the `message` property. * @param key - A key to give the element a stable identity. This is used to improve compatibility with screen readers. * @param ariaHidden - If "true" then content will be hidden from screen readers.

(key: string, ariaHidden: 'true' | null = null)

Source from the content-addressed store, hash-verified

658 * @param ariaHidden - If "true" then content will be hidden from screen readers.
659 */
660 private renderToastMessage(key: string, ariaHidden: 'true' | null = null) {
661 const { customHTMLEnabled, message } = this;
662 if (customHTMLEnabled) {
663 return (
664 <div
665 key={key}
666 aria-hidden={ariaHidden}
667 class="toast-message"
668 part="message"
669 innerHTML={sanitizeDOMString(message)}
670 ></div>
671 );
672 }
673
674 return (
675 <div key={key} aria-hidden={ariaHidden} class="toast-message" part="message">
676 {message}
677 </div>
678 );
679 }
680
681 /**
682 * Render the `header` property.

Callers 1

renderMethod · 0.95

Calls 1

sanitizeDOMStringFunction · 0.90

Tested by

no test coverage detected