Toolverse
All skills

rerender-functional-setstate

by TheOrcDev

Use functional setState updates to prevent stale closures and unnecessary callback recreations. Apply when updating state based on the current state value in React components.

Installation

Pick a client and clone the repository into its skills directory.

Installation

Quick info

Author
TheOrcDev
Category
Frontend
Views
2

About this skill

Use functional setState updates to prevent stale closures and unnecessary callback recreations. Apply when updating state based on the current state value in React components.

How to use

  1. Zainstaluj skill w swoim projekcie Claude'a, dodając plik do katalogu .claude/skills/ lub importując go w konfiguracji agenta.

  2. Kiedy piszesz komponent React ze stanem, który aktualizujesz na podstawie jego bieżącej wartości, poproś Claude'a o zastosowanie tego skilla. Wskaż miejsca, gdzie używasz setItems([...items, ...newItems]) lub podobnych wzorców.

  3. Skill pokaże Ci, jak zmienić bezpośrednie odwołanie do zmiennej stanu na funkcję. Zamiast setItems([...items, ...newItems]) napiszesz setItems(curr => [...curr, ...newItems]).

  4. Usuń zmienną stanu z tablicy zależności useCallback. Ponieważ funkcja aktualizująca zawsze otrzymuje aktualną wartość, nie musisz już dodawać stanu jako zależności.

  5. Zweryfikuj, że callbacki są teraz stabilne — nie powinny być tworzone na nowo przy każdej zmianie stanu. To zmniejszy niepotrzebne re-rendery komponentów potomnych.

  6. Sprawdź, czy problem stałych zamknięć zniknął. Jeśli zapomniałeś wcześniej dodać stan do zależności, teraz callback będzie zawsze pracować z aktualną wartością.

Related skills

interactive-dashboard-builder

by anthropics

Build self-contained interactive HTML dashboards with Chart.js, dropdown filters, and professional styling. Use when creating dashboards, building interactive reports, or generating shareable HTML files with charts and filters that work without a server.

Frontend
2298

browser-automation

by browserbase

Automate web browser interactions using natural language via CLI commands. Use when the user asks to browse websites, navigate web pages, extract data from websites, take screenshots, fill forms, click buttons, or interact with web applications. Triggers include \

Frontend
21175

google-official-seo-guide

by littleben

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

Frontend
101196

livewire-development

by spatie

Develops reactive Livewire 4 components. Activates when creating, updating, or modifying Livewire components; working with wire:model, wire:click, wire:loading, or any wire: directives; adding real-time updates, loading states, or reactivity; debugging component behavior;

Frontend
2335

frontend-slides

by sickn33

Create stunning, animation-rich HTML presentations from scratch or by converting PowerPoint files. Use when the user wants to build a presentation, convert a PPT/PPTX to web, or create slides for a talk/pitch. Helps non-designers discover their aesthetic through visual

Frontend
65135

shadcn-ui-setup

by maneeshanif

Install and configure Shadcn/ui component library with Radix UI primitives, Aceternity UI effects, set up components, and manage the component registry. Use when adding Shadcn/ui to a Next.js project or installing specific UI components for Phase 2.

Frontend
23167