원클릭으로
react-patterns
Advanced React patterns and best practices used in this portfolio
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Advanced React patterns and best practices used in this portfolio
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
| name | react-patterns |
| description | Advanced React patterns and best practices used in this portfolio |
Advanced React patterns, hooks, and best practices as applied in the PP Namias portfolio.
The portfolio uses a modal system built with compound components:
// src/components/ui/Modal.tsx
<Modal isOpen={isOpen} onClose={onClose}>
<ModalHeader>Title</ModalHeader>
<ModalBody>Content</ModalBody>
<ModalFooter>Actions</ModalFooter>
</Modal>
Registration: All modals are registered in src/hooks/useModal.tsx with typed keys.
// Always isolate SWR in tests
<SWRConfig value={{ provider: () => new Map() }}>
<Component />
</SWRConfig>
All sections follow the same pattern:
// src/components/sections/SectionName.tsx
'use client';
import { motion } from 'framer-motion';
export default function SectionName({ data }: Props) {
return (
<section>
<motion.div whileInView={{ opacity: 1 }} />
</section>
);
}
// Always use OptimizedImage, not raw <img>
<OptimizedImage
src={url}
alt={alt}
width={800}
height={600}
priority={isAboveFold}
/>
const TabsContext = createContext(null);
function Tabs({ children, defaultValue }) {
const [active, setActive] = useState(defaultValue);
return (
<TabsContext.Provider value={{ active, setActive }}>
<div>{children}</div>
</TabsContext.Provider>
);
}
function useMediaQuery(query: string) {
const [matches, setMatches] = useState(false);
useEffect(() => {
const mql = window.matchMedia(query);
setMatches(mql.matches);
const handler = (e: MediaQueryListEvent) => setMatches(e.matches);
mql.addEventListener('change', handler);
return () => mql.removeEventListener('change', handler);
}, [query]);
return matches;
}
// Split value and dispatch to prevent unnecessary re-renders
const StateContext = createContext(null);
const DispatchContext = createContext(null);
provider: () => new Map())useModal.tsxOptimizedImage componentMigrate from Next.js 15 to Next.js 16 and handle breaking changes
Configure Content Security Policy and security headers for the portfolio
Deploy Next.js to Cloudflare Workers using OpenNext adapter
Manage the canary token honeypot system for detecting security scanning
Write, debug, and optimize GROQ queries for Sanity CMS in this portfolio
Advanced TypeScript patterns and type safety as used in this portfolio