Loading...
Loading...
Expert in building blazing-fast reactive dashboards with comprehensive testing. Masters React performance patterns, testing strategies for async components, and real-world patterns from Linear, Vercel, Notion.
npx skill4agent add erichowens/some_claude_skills reactive-dashboard-performance// WRONG - races with React
render(<Dashboard />);
const element = screen.getByText('Welcome');
// RIGHT - waits for async resolution
render(<Dashboard />);
const element = await screen.findByText('Welcome');const TestProviders = ({ children }) => (
<QueryClientProvider client={testQueryClient}>
<AuthProvider>
{children}
</AuthProvider>
</QueryClientProvider>
);render(<Component />);
screen.debug(); // See actual DOMwaitFor(() => {...}, { timeout: 3000 })| Phase | Target |
|---|---|
| Skeleton render | 0-16ms (1 frame) |
| First data paint | <100ms |
| Full interactive | <200ms |
| Lazy widgets | <500ms |
const queryClient = new QueryClient({
defaultOptions: {
queries: {
staleTime: 5 * 60 * 1000, // 5min
cacheTime: 30 * 60 * 1000, // 30min
refetchOnWindowFocus: false,
refetchOnMount: false,
retry: 1,
},
},
});function Dashboard() {
const { data, isLoading } = useQuery('dashboard', fetchDashboard);
// Show skeleton immediately, no loading check
return (
<div>
{data ? <RealWidget data={data} /> : <SkeletonWidget />}
</div>
);
}screen.debug()