@@ -548,6 +547,23 @@ createRoot(document.getElementById('container')).render();
);
+ useEffect(() => {
+ // In Safari, if style tag be inserted into non-head tag,
+ // it will affect the rendering ability of the browser,
+ // resulting in some response delays like following issue:
+ // https://github.com/ant-design/ant-design/issues/39995
+ // So we insert style tag into head tag.
+ if (!style) return;
+ const styleTag = document.createElement('style');
+ styleTag.type = 'text/css';
+ styleTag.innerHTML = style;
+ styleTag['data-demo-url'] = demoUrl;
+ document.head.appendChild(styleTag);
+ return () => {
+ document.head.removeChild(styleTag);
+ };
+ }, [style, demoUrl]);
+
if (version) {
return (