Skip to content

Commit a3834b1

Browse files
Ajit Pratap Singhclaude
authored andcommitted
fix: address PR review suggestions for #439
- Wrap FadeIn in memo() to prevent unnecessary re-renders from parent state changes that don't affect the component's own props - Log suppressed extension noise errors to console.debug in development so they remain visible locally while staying off Sentry in production Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent f430560 commit a3834b1

2 files changed

Lines changed: 10 additions & 6 deletions

File tree

website/src/components/ui/FadeIn.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use client';
22
import { motion, useReducedMotion } from 'framer-motion';
3-
import { ReactNode, useState, useEffect } from 'react';
3+
import { ReactNode, useState, useEffect, memo } from 'react';
44

5-
export function FadeIn({ children, delay = 0, className = '' }: { children: ReactNode; delay?: number; className?: string }) {
5+
export const FadeIn = memo(function FadeIn({ children, delay = 0, className = '' }: { children: ReactNode; delay?: number; className?: string }) {
66
const shouldReduce = useReducedMotion();
77
const [isMounted, setIsMounted] = useState(false);
88

@@ -29,4 +29,4 @@ export function FadeIn({ children, delay = 0, className = '' }: { children: Reac
2929
{children}
3030
</motion.div>
3131
);
32-
}
32+
});

website/src/instrumentation-client.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@ Sentry.init({
2424
// 2. "Object Not Found Matching Id:N, MethodName:update" — Chrome DevTools
2525
// Protocol messages from extensions interacting with CodeMirror/Monaco.
2626
// The error originates outside our code and only affects a single session.
27-
if (
27+
const isExtensionNoise =
2828
msg.includes("Cannot assign to read only property 'pushState'") ||
29-
msg.includes("Object Not Found Matching Id:")
30-
) {
29+
msg.includes("Object Not Found Matching Id:");
30+
31+
if (isExtensionNoise) {
32+
if (process.env.NODE_ENV === "development") {
33+
console.debug("[Sentry] Suppressed extension noise:", msg);
34+
}
3135
return null;
3236
}
3337

0 commit comments

Comments
 (0)