Loading...
Loading...
React component development guide. Use when working with React components (.tsx files), creating UI, using @lobehub/ui components, implementing routing, or building frontend features. Triggers on React component creation, modification, layout implementation, or navigation tasks.
npx skill4agent add lobehub/lobehub reactstyleFlexboxCenter@lobehub/uireferences/layout-kit.mdsrc/components@lobehub/uinode_modules/@lobehub/ui/es/index.mjs| Route Type | Use Case | Implementation |
|---|---|---|
| Next.js App Router | Auth pages (login, signup, oauth) | |
| React Router DOM | Main SPA (chat, settings) | |
src/app/[variants]/page.tsxsrc/app/[variants]/router/desktopRouter.config.tsxsrc/app/[variants]/(mobile)/router/mobileRouter.config.tsxsrc/utils/router.tsximport { dynamicElement, redirectElement, ErrorBoundary } from '@/utils/router';
element: dynamicElement(() => import('./chat'), 'Desktop > Chat');
element: redirectElement('/settings/profile');
errorElement: <ErrorBoundary resetPath="/chat" />;Linkreact-router-domnext/link// ❌ Wrong
import Link from 'next/link';
<Link href="/">Home</Link>;
// ✅ Correct
import { Link } from 'react-router-dom';
<Link to="/">Home</Link>;
// In components
import { useNavigate } from 'react-router-dom';
const navigate = useNavigate();
navigate('/chat');
// From stores
const navigate = useGlobalStore.getState().navigate;
navigate?.('/settings');