react
/react
Wspiera pracę z React 19: Server Components, hooki, optymalizacje kompilatora i funkcje współbieżne w nowoczesnych interfejsach webowych i aplikacjach SPA.
- Autor
- G1Joshi ↗
- Repozytorium
- Agent-Skills ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 01.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 2
Brak sygnałów. Repozytorium zmienione 01.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Wspiera pracę z React 19: Server Components, hooki, optymalizacje kompilatora i funkcje współbieżne w nowoczesnych interfejsach webowych i aplikacjach SPA.
Oryginalny opis (EN)
Expert React assistance covering React 19, Server Components (RSC), hooks, compiler optimizations, and concurrent features. Use when building modern web user interfaces and single-page apps.
Jak działa
- When to Use
- Quick Start
- Core Concepts
- Common Patterns
- Best Practices
- Troubleshooting
- References
Podgląd SKILL.md
---
name: react
description: Expert React assistance covering React 19, Server Components (RSC), hooks, compiler optimizations, and concurrent features. Use when building modern web user interfaces and single-page apps.
---
# React
React is the standard library for building declarative user interfaces, featuring the React Compiler, Server Components, concurrent rendering, and native Actions.
## When to Use
- **Single Page Apps (SPA)**: Rich, interactive dashboards.
- **Complex UI**: Applications with many moving parts and state.
- **Ecosystem**: When you need the largest library of 3rd party components.
## Quick Start
```tsx
import { use, Suspense } from "react";
// New: 'use' hook for promises
function Comments({ commentsPromise }) {
const comments = use(commentsPromise);
return comments.map((c) => <p key={c.id}>{c.text}</p>);
}
export default function Page({ id }) {
const commentsPromise = fetchComments(id);
return (
<Suspense fallback={<p>Loading...</p>}>
<Comments commentsPromise={commentsPromise} />
</Suspense>
);
}
```
## Core Concepts
### React Compiler
React 19 introduces an auto-memoizing compiler. You no longer need `useMemo` or `useCallback` manually in 99% of cases. The compiler treats code as "memoized by default".
### Server Components (RSC)
Components that run _only_ on the server. They don't send JS to the client.
- **`'use server'`**: Marks a function as a Server Action (callable from client).
- **`'use client'`**: Marks a component as interactive (hydrated on client).
### Actions and `useActionState`
Native support for async form submission.
```tsx
function Form() {
const [error, submitAction, isPending] = useActionState(
async (prev, formData) => {
const error = await updateProfile(formData);
if (error) return error;
return null;
},
null,
);
return (
<form action={submitAction}>
<input name="name" />
<button disabled={isPending}>Save</button>
{error && <p>{error}</p>}
</form>
);
}
```
## Common Patterns
### Custom Reusable Hook with Cleanup
**Problem**: Duplicating event listeners or subscription lifecycles across UI components.
**Solution**:
Encapsulate logic in a typed custom hook:
```typescript
import { useState, useEffect } from "react";
export function useWindowWidth() {
const [width, setWidth] = useState(() =>
typeof window !== "undefined" ? window.innerWidth : 1024,
);
useEffect(() => {
const handleResize = () => setWidth(window.innerWidth);
window.addEventListener("resize", handleResize);
return () => window.removeEventListener("resize", handleResize);
}, []);
return width;
}
```
## Best Practices
**Do**:
- Trust the Compiler: Stop writing `useMemo`/`useCallback` unless you are building a library or strictly optimizing.
- Use Server Actions: Replace manual `fetch('/api/...')` with robust Server Actions for data mutations.
- Use `ref` as a prop: In React 19, `ref` is a plain prop. No more `forwardRef`.
**Don't**:
- Overuse `useEffect`: Effects are for synchronization with external systems, not for data fetching or derived state.
- Spread props blindly: Pass explicit props to make components easier to debug.
## Troubleshooting
| Error | Cause | Solution |
| :------------------------------------------------------------------------------------ | :---------------------------------------------------------------------------- | :-------------------------------------------------------------------------------- |
| `Too many re-renders. React limits the number of renders to prevent an infinite loop` | State setter invoked directly in component body instead of handler/useEffect. | Wrap setter call inside an event handler or `useEffect`: `() => setCount(c + 1)`. |
| `Rendered fewer hooks than expected` | Hook called inside a conditional `if` statement or loop. | Always call React hooks at the top level of component before conditionals. |
| `Hydration mismatch: Text content does not match server-rendered HTML` | Client-only values evaluated during initial server render. | Use `suppressHydrationWarning` on element or load after mount. |
## References
- [React 19 Blog](https://react.dev/blog/2024/04/25/react-19)
- [React Documentation](https://react.dev/)
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · G1Joshi/Agent-Skills | 100 | MIT |
| ericrisco/rsc-harness | 100 | MIT |
| mintuz/claude-plugins | 100 | MIT |
| frankxai/claude-skills-library | 100 | MIT |
| kriscard/Skills | 100 | MIT |
| xobotyi/cc-foundry | 100 | MIT |
| openops-cloud/openops | 100 | Apache-2.0 |
| bennypowers/cem | 100 | GPL-3.0 |
| nimadorostkar/Claude-Skills-collection | 100 | MIT |
Migawka bazy z 13.11.2026 · wersja paczki c41bbb5c0875 (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100react-server-components
Pomaga budować aplikacje React z Server Components, które ograniczają JavaScript po stronie klienta i strumieniują dane. - 100nextjs
Wspiera pracę z Next.js: App Router, Server Components, Server Actions, metadane SEO i edge runtime, przy budowie pełnostackowych aplikacji React. - 100react-modernization
Modernizuje aplikacje React: przechodzi z komponentów klasowych na hooki, aktualizuje wersje i wdraża funkcje współbieżne. - 95react-modernization
Aktualizuje aplikacje React do najnowszych wersji, migruje komponenty klasowe na hooki i wdraża funkcje współbieżne. - 100react-modernization
Aktualizuje aplikacje React do najnowszych wersji, migruje komponenty klasowe na hooki i wprowadza funkcje współbieżne. - 100frontend-react
Wspiera tworzenie aplikacji React z Next.js, React Server Components, Tailwind CSS i shadcn/ui oraz złożonym zarządzaniem stanem.