Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove broken dangerouslySetInnerHTML property on mounting div in Inl…
…ineStory
  • Loading branch information
valentinpalkovic committed Aug 4, 2023
commit caf8e1be0f5beaec6a1a169376b7d1ff6153efc8
11 changes: 1 addition & 10 deletions code/ui/blocks/src/components/Story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ const InlineStory: FunctionComponent<InlineStoryProps> = (props) => {
};
}, [autoplay, renderStoryToElement, story]);

// We do this so React doesn't complain when we replace the span in a secondary render
const htmlContents = `<span></span>`;

if (error) {
return (
<pre>
Expand All @@ -83,13 +80,7 @@ const InlineStory: FunctionComponent<InlineStoryProps> = (props) => {
)} { min-height: ${height}; transform: translateZ(0); overflow: auto }`}</style>
) : null}
{showLoader && <StorySkeleton />}
<div
ref={storyRef}
id={`${storyBlockIdFromId(props)}-inner`}
data-name={story.name}
// eslint-disable-next-line react/no-danger
dangerouslySetInnerHTML={{ __html: htmlContents }}
/>
<div ref={storyRef} id={`${storyBlockIdFromId(props)}-inner`} data-name={story.name} />
</>
);
};
Expand Down