Drop react-markdown node prop from rendered comment links

The custom `a` renderer spread react-markdown's internal `node` prop onto
the anchor, leaking node="[object Object]" into the DOM on every comment link.
Destructure it out.
This commit is contained in:
2026-07-31 19:48:31 +05:00
parent 2498d0f8da
commit 917253990b
+2 -1
View File
@@ -51,7 +51,8 @@ function CommentBody({ text }: { text: string }) {
<ReactMarkdown <ReactMarkdown
rehypePlugins={[rehypeSanitize]} rehypePlugins={[rehypeSanitize]}
components={{ components={{
a: ({ ...props }) => <a {...props} target="_blank" rel="noopener noreferrer" />, // eslint-disable-next-line @typescript-eslint/no-unused-vars -- отбрасываем служебный node от react-markdown, чтобы он не протекал в DOM
a: ({ node, ...props }) => <a {...props} target="_blank" rel="noopener noreferrer" />,
}} }}
> >
{text} {text}