com um clique
react-typescript
React 19 + TypeScript patterns, hooks, types, and best practices
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Menu
React 19 + TypeScript patterns, hooks, types, and best practices
Instalar com Codex ou Claude Copie este prompt, cole no Codex, Claude ou outro assistente e deixe que ele revise a página da skill e instale para você.
Baseado na classificação ocupacional SOC
Chrome DevTools automation for browser testing, debugging, and performance analysis
Clojure development workflows including REPL, deps.edn, testing, and linting
Docker Compose orchestration for multi-container applications
Full stack integration patterns connecting Clojure backend and React frontend
Git workflow management including branching, commits, PRs, and conflict resolution
OpenCode plugin development guidance including structure, events, tools, patterns, and best practices
| name | react-typescript |
| description | React 19 + TypeScript patterns, hooks, types, and best practices |
| license | MIT |
| compatibility | opencode |
| metadata | {"audience":"frontend-developers","frameworks":"react typescript"} |
Use me when building React + TypeScript applications, especially when:
interface Props {
title: string;
count: number;
onIncrement?: () => void;
}
export function Counter({ title, count, onIncrement }: Props) {
return (
<div>
<h1>{title}</h1>
<p>Count: {count}</p>
<button onClick={onIncrement}>Increment</button>
</div>
);
}
useState<T>(initialValue) - Type state explicitly if inferreduseEffect(() => { ... }, [deps]) - Include all dependenciesuseMemo(() => expensive(a, b), [a, b]) - Memoize expensive valuesuseCallback(() => action(a, b), [a, b]) - Memoize callbacksuseRef<T>(null) - Type refs with genericuseContext(Context) - Type context with Context type// Props with optional and union types
interface ButtonProps {
variant: 'primary' | 'secondary';
disabled?: boolean;
onClick: (event: React.MouseEvent<HTMLButtonElement>) => void;
}
// Generic components
interface ListProps<T> {
items: T[];
render: (item: T) => React.ReactNode;
}
function List<T>({ items, render }: ListProps<T>) {
return <ul>{items.map(render)}</ul>;
}
// Form events
handleSubmit(event: React.FormEvent<HTMLFormElement>) {
event.preventDefault();
// Access form: event.currentTarget.elements.name.value
}
// Input events
handleChange(event: React.ChangeEvent<HTMLInputElement>) {
setValue(event.target.value);
}
// Mouse events
handleClick(event: React.MouseEvent<HTMLButtonElement>) {
console.log(event.clientX, event.clientY);
}
React.memo for components that shouldn't re-renderuseMemo for expensive calculationsuseCallback for child props// Create typed context
interface AppContext {
user: User | null;
login: (email: string) => Promise<void>;
}
const AppContext = createContext<AppContext | null>(null);
// Provider component
function AppProvider({ children }: { children: React.ReactNode }) {
const [user, setUser] = useState<User | null>(null);
const login = useCallback(async (email: string) => {
// ...
}, []);
return (
<AppContext.Provider value={{ user, login }}>
{children}
</AppContext.Provider>
);
}
// Custom hook to use context
function useApp() {
const context = useContext(AppContext);
if (!context) throw new Error('useApp must be used within AppProvider');
return context;
}
interface ErrorBoundaryProps {
children: React.ReactNode;
fallback?: React.ReactNode;
}
class ErrorBoundary extends Component<ErrorBoundaryProps, { error: Error | null }> {
state = { error: null };
static getDerivedStateFromError(error: Error) {
return { error };
}
componentDidCatch(error: Error, errorInfo: ErrorInfo) {
console.error('Error caught:', error, errorInfo);
}
render() {
if (this.state.error) {
return this.props.fallback || <div>Something went wrong</div>;
}
return this.props.children;
}
}
useForm from libraries (react-hook-form) for complex forms<React.StrictMode> in development"strict": true in tsconfig.jsonunknown instead of any for dynamic data