Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

react

/react

Wspiera pracę z React 19: Server Components, hooki, optymalizacje kompilatora i funkcje współbieżne w nowoczesnych interfejsach webowych i aplikacjach SPA.

Repozytorium
Agent-Skills ↗
Licencja
MIT
Ostatnia zmiana repozytorium
01.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
1
Skrypty
0
Komentarze HTML
0
Adresy URL w SKILL.md
2
Przestarzałość

Brak sygnałów. Repozytorium zmienione 01.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

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

  1. When to Use
  2. Quick Start
  3. Core Concepts
  4. Common Patterns
  5. Best Practices
  6. Troubleshooting
  7. References
Sekcje z nagłówków SKILL.md, w oryginale · 124 linii, 523 słów
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

RepozytoriumWynikLicencja
Ta strona · G1Joshi/Agent-Skills100MIT
ericrisco/rsc-harness100MIT
mintuz/claude-plugins100MIT
frankxai/claude-skills-library100MIT
kriscard/Skills100MIT
xobotyi/cc-foundry100MIT
openops-cloud/openops100Apache-2.0
bennypowers/cem100GPL-3.0
nimadorostkar/Claude-Skills-collection100MIT

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.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.