con un clic
debug-component
Debug React components and resolve common issues in Next.js 15
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Menú
Debug React components and resolve common issues in Next.js 15
Instalar con Codex o Claude Copia este prompt, pégalo en Codex, Claude u otro asistente, y deja que revise la página de la skill y la instale por ti.
Add a new Recharts visualization with theme-aware styling to the dashboard
Add a new metric card to the dashboard with proper styling and components
Add Lucide React icons to components following project conventions
Add responsive layouts following mobile-first design principles with Tailwind CSS
Add a new shadcn/ui component to the project following the New York style variant
Add or customize theme colors in the CSS custom properties system
Basado en la clasificación ocupacional SOC
| name | debug-component |
| description | Debug React components and resolve common issues in Next.js 15 |
When debugging components in this Next.js 15 dashboard:
"use client" vs Server Component issues:
"use client"; at the top of the fileHydration errors:
// Use client-only rendering for dynamic content
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);
if (!mounted) return null;
CSS variable issues in charts:
globals.cssuseChartColors hook in chart componentsconst colors = useChartColors();
// Use colors.chart1, colors.chart2, etc.
TypeScript errors:
interface ComponentProps {
title: string;
value: number;
optional?: string;
}
as const for literal types:changeType: "positive" as const
Import path issues:
tsconfig.json@/components/...@/lib/...@/app/...Theme not applying:
hsl(var(--color-name)):root and .dark selectorsChart not responsive:
<ResponsiveContainer width="100%" height={250}>
<LineChart data={data}>...</LineChart>
</ResponsiveContainer>
Development debugging tools:
// Console logging (remove in production)
console.log("Debug:", { props, state });
// React DevTools
// Install React Developer Tools browser extension
// Type checking
npm run lint
Common linting errors:
useEffect(() => {
doSomething(value);
}, [value]); // Add value to dependencies
Performance issues:
"use client";
import { useState, useEffect } from "react";
export default function DynamicComponent() {
const [mounted, setMounted] = useState(false);
useEffect(() => {
setMounted(true);
}, []);
if (!mounted) {
return <div>Loading...</div>;
}
return <div>{new Date().toLocaleString()}</div>;
}
// Define clear interfaces
interface StatCardProps {
title: string;
value: string;
change: string;
changeType: "positive" | "negative"; // Union type
icon: React.ComponentType<{ className?: string }>;
}
export function StatCard({ title, value, change, changeType, icon }: StatCardProps) {
// Component implementation
}
"use client";
import { useEffect } from "react";
function ChartComponent() {
const colors = useChartColors();
// Debug colors
useEffect(() => {
console.log("Chart colors:", colors);
}, [colors]);
return (
<LineChart data={data}>
<Line stroke={colors.chart1} />
</LineChart>
);
}
src/app/layout.tsxsrc/app/globals.csstsconfig.jsonnext.config.tsoptimize-react-componentadd-chartadd-theme-colors