feat: Allow ReactNode as children/content of the Toast - closes #6038
Closes #6038
✅ Pull Request Checklist:
- [x] Included link to corresponding React Spectrum GitHub Issue.
- [x] Added/updated unit tests and storybook for this change (for new code or code which already has tests).
- [x] Filled out test instructions.
- [x] Updated documentation (if it already exists for this component).
- [x] Looked at the Accessibility Practices for this feature - Aria Practices
📝 Test Instructions:
yarn jest
@snowystinger
If the team decides for text parse, is it okay to use additional property in options (like allowHtmlParse) to skip unnecessary RegEx checks for better perf?
I was thinking very simple. IE, only allow bold. I'm not too worried about perf, it's a short string for an element that doesn't appear frequently and shouldn't rerender much.
I guess that would be good to include also a span tag for the possibility of adding class to specific parts of the text. Might not be up to Adobe internal guidelines, but useful for third-party.
We should be talking about this later this week.
However, you brought up an important point. Which is that this is useful for non-spectrum users. We intend to make a RAC toast implementation which should alleviate this particular use case.
RAC Toasts have landed in alpha https://react-spectrum.adobe.com/react-aria/Toast.html you handle rendering Toasts yourself so can put whatever you like into it. Do you still need this particular PR?
We've still not landed on a good solution for Spectrum side of things