In the example here: https://shopify.dev/docs/api/admin-extensions/unstable/components/titles-and-text/banner it shows a hyper link in the message of the banner. When I add the naive implementation of that, it html-escapes the message. How do I implement that hyperlink? (or how did they do it in the example?)
Hi - are you making any changes at all to the example that’s shown in the docs:
import React from 'react';
import {
render,
Banner,
Paragraph,
} from '@shopify/ui-extensions-react/admin';
render('Playground', () => <App />);
function App() {
return (
<Banner title="Shipping rates changed" dismissible onDismiss={() => console.log('dismissed banner')}>
<Paragraph>Your store may be affected</Paragraph>
</Banner>
);
}
@Liam-Shopify - Thank you so much for your prompt reply and help. I really appreciate it.
This is the preview from the documentation I’m talking about:
This preview is not generated by the code in the example but it does show the behavior I’m looking for. I tried something like this:
root.append(root.createComponent(Banner, {
title: 'Pithy Title',
tone: "success"
},
"<a href=#>link!</a>"
));
It generated this: