Correctly resize full width images when table of contents is opened/closed (#5826)

* stash

* restore

* Self review
This commit is contained in:
Tom Moor
2023-09-12 21:33:25 -04:00
committed by GitHub
parent d81db7e4f6
commit b80ee89588
6 changed files with 86 additions and 69 deletions

View File

@@ -8,7 +8,7 @@ const URL_REGEX = /^https:\/\/(www\.)?berrycast.com\/conversations\/(.*)$/;
export default function Berrycast(props: Props) {
const normalizedUrl = props.attrs.href.replace(/\/$/, "");
const ref = React.useRef<HTMLDivElement>(null);
const { width } = useComponentSize(ref);
const { width } = useComponentSize(ref.current);
return (
<>