Issue #3466303: Component previews in left menu don't have style encapsulation
Merged
requested to merge issue/experience_builder-3466303:3466303-wrap-preview-in-ShadowDom into 0.x
2 unresolved threads
Closes #3466303
Merge request reports
Activity
added 2 commits
282 283 styles.ComponentPreviewContent, 283 284 )} 284 285 > 285 {previewContent && ( 286 <div 287 dangerouslySetInnerHTML={{ __html: previewContent }} 288 /> 289 )} 286 <ShadowWrapper> 287 {previewContent && ( changed this line in version 4 of the diff
- ui/src/components/ShadowWrapper.tsx 0 → 100644
12 const containerRef = useRef<HTMLDivElement | null>(null); 13 const contentRef = useRef<HTMLDivElement | null>(null); 14 15 useEffect(() => { 16 if (containerRef.current && !shadowRootRef.current) { 17 shadowRootRef.current = containerRef.current.attachShadow({ 18 mode: 'open', 19 }); 20 21 const wrapper = document.createElement('div'); 22 shadowRootRef.current.appendChild(wrapper); 23 contentRef.current = wrapper; 24 } 25 26 if (contentRef.current) { 27 ReactDOM.render(<>{children}</>, contentRef.current); I'm getting an error
Warning: ReactDOM.render is no longer supported in React 18. Use createRoot instead. Until you switch to the new API, your app will behave as if it's running React 17. Learn more: https://reactjs.org/link/switch-to-createroot
Can this be updated to use createRoot?
changed this line in version 4 of the diff
added 1 commit
- 8fde2f2e - Removed unwanted extra divs and addressed feedbacks
added 7 commits
-
8fde2f2e...1fbdc356 - 2 commits from branch
project:0.x
- 6616c518 - Issue #3466303: Component previews in left menu don't have style encapsulation
- c15481ae - Added class to shadowDom Wrapper
- 2f454eb6 - Attempt to make tests pass
- 14bbc2c0 - Fixed tests and removed unwanted changes
- 424670e1 - Removed unwanted extra divs and addressed feedbacks
Toggle commit list-
8fde2f2e...1fbdc356 - 2 commits from branch
Please register or sign in to reply