Create and implement a reusable React component with props and state
When you need to build a reusable UI component in React that accepts props and manages its own state.
create-react-app or similar)Create component file: touch src/components/MyComponent.js
Import React: Add import React, { useState } from 'react'; at the top
Define component function: function MyComponent({ title, onClick }) { const [count, setCount] = useState(0);
return ( <div> <h2>{title}</h2> <button onClick={() => setCount(count + 1)}> Clicked {count} times </button> {onClick && <button onClick={onClick}>Action</button>} </div> ); }
Export component: Add export default MyComponent; at the bottom
Import in parent: import MyComponent from './components/MyComponent';
Use component: <MyComponent title="My Title" onClick={handleClick} />
npx skills add Snehal707/create-react-component下载完整 Skill 目录,包含 SKILL.md 及所有相关文件
Search for places (restaurants, cafes, etc.) via Google Places API proxy on localhost.
Interact with GitHub using the `gh` CLI. Use `gh issue`, `gh pr`, `gh run`, and `gh api` for issues, PRs, CI runs, and advanced queries.
Create or update AgentSkills. Use when designing, structuring, or packaging skills with scripts, references, and assets.
Start voice calls via the OpenClaw voice-call plugin.
Notion API for creating and managing pages, databases, and blocks.
Gemini CLI for one-shot Q&A, summaries, and generation.
Category:developer