We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cba60c0 commit 4484dfeCopy full SHA for 4484dfe
src/features/ui/chat/chat-message-area/chat-message-content.tsx
@@ -9,8 +9,9 @@ const ChatMessageContentArea: ForwardRefRenderFunction<
9
ChatMessageContentAreaProps
10
> = (props, ref) => {
11
useEffect(() => {
12
- const links = ref.current?.querySelectorAll('a'); // Select all anchor tags in the current ref
13
- if (links) {
+ // Check if ref.current is not null
+ if (ref.current) {
14
+ const links = ref.current.querySelectorAll('a'); // Select all anchor tags in the current ref
15
links.forEach(link => {
16
link.setAttribute('target', '_blank'); // Open in new tab
17
link.setAttribute('rel', 'noopener noreferrer'); // Security measure
0 commit comments