ionic-react
БесплатноБез исполняемых скриптовНе проверенGuides the agent through Ionic Framework development with React — project structure, React-specific Ionic components, IonReactRouter and navigation patterns…
от capawesome-team★ 56 звёзд на GitHubОб этом скилле
Ionic React
Develop Ionic Framework apps with React — project structure, IonReactRouter, React-specific components, lifecycle hooks, state management, and best practices.
Prerequisites
- Ionic Framework 7 or 8 with
@ionic/react. - React 18 or later.
- Node.js and npm installed.
- For iOS: Xcode installed.
- For Android: Android Studio installed.
Agent Behavior
- Auto-detect before asking. Check the project for
package.jsondependencies (@ionic/react,@ionic/react-router,react,@capacitor/core), platforms (android/,ios/), build tools, and TypeScript usage. Only ask the user when something cannot be detected. - Guide step-by-step. Walk the user through the process one step at a time. Never present multiple unrelated questions at once.
- Adapt to the project. Detect the existing code style (TypeScript vs. JavaScript, state management library, routing setup) and generate code that matches.
Procedures
Step 1: Analyze the Project
Auto-detect the following by reading project files:
- Ionic version: Read
@ionic/reactversion frompackage.json. - React version: Read
reactversion frompackage.json. - Capacitor version: Read
@capacitor/coreversion frompackage.json(if present). - TypeScript: Check if
tsconfig.jsonexists and if.tsxfiles are used. - Router: Check if
@ionic/react-routerandreact-router-domare inpackage.json. - State management: Check
package.jsonforredux,@reduxjs/toolkit,zustand,jotai,@tanstack/react-query, or similar. - Platforms: Check which directories exist (
android/,ios/). - Build tool: Check for
vite.config.ts,angular.json,webpack.config.js, etc.
Step 2: Project Structure
A standard Ionic React project follows this structure:
project-root/
├── android/ # Android native project (Capacitor)
├── ios/ # iOS native project (Capacitor)
├── public/
├── src/
│ ├── components/ # Reusable UI components
│ ├── hooks/ # Custom React hooks
│ ├── pages/ # Page components (one per route)
│ ├── services/ # Service modules for API and native calls
│ ├── context/ # React context providers
│ ├── theme/
│ │ └── variables.css # Ionic CSS custom properties
│ ├── App.tsx # Root component with IonReactRouter
│ └── main.tsx # Entry point with setupIonicReact()
├── capacitor.config.ts # Capacitor configuration
├── ionic.config.json # Ionic CLI configuration
├── package.json
├── tsconfig.json
└── vite.config.ts # Or other bundler config
If the project does not follow this structure, adapt all guidance to the project's actual directory layout. Do not restructure the project unless the user explicitly asks.
Step 3: App Initialization
The entry point must call setupIonicReact() before rendering the app. This function initializes the Ionic Framework for React.
Verify that src/main.tsx (or src/index.tsx) contains:
import { setupIonicReact } from '@ionic/react';
setupIonicReact();
setupIonicReact() accepts an optional configuration object for global settings:
setupIonicReact({
mode: 'ios', // Force iOS mode on all platforms ('ios' | 'md')
rippleEffect: false, // Disable Material Design ripple effect
animated: true, // Enable/disable all animations
});
If setupIonicReact() is missing or called after rendering, Ionic components will not function correctly.
Step 4: Routing and Navigation
Read references/routing.md for complete routing patterns including:
IonReactRoutersetupIonRouterOutletpage management- Tab-based navigation with
IonTabs - Side menu navigation with
IonMenu - Programmatic navigation with
useIonRouter - Route guards and route parameters
Key principles:
- Use
IonReactRouterinstead of React Router'sBrowserRouter. It is required for Ionic page transitions. - Use
IonRouterOutletto contain routes. It manages the page stack and transition animations. - Pass
componentprop toRoute— do not userenderorchildreninsideIonRouterOutlet. - Use
useIonRouterfor programmatic navigation — it provides Ionic-aware navigation with transition animations.
Step 5: Ionic Lifecycle Hooks
Read references/lifecycle.md for detailed lifecycle hook usage.
Ionic React pages stay mounted in the DOM after navigation. Standard React useEffect only fires on initial mount, not on every page visit. Use Ionic lifecycle hooks for per-visit logic:
| Hook | Use for |
|---|---|
useIonViewWillEnter |
Refresh data before the page becomes visible |
useIonViewDidEnter |
St |
Установить ionic-react в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл ionic-react?
Guides the agent through Ionic Framework development with React — project structure, React-specific Ionic components, IonReactRouter and navigation patterns, Ionic lifecycle hooks (useIonViewWillEnter, useIonViewDidEnter, useIonViewWillLeave, useIonViewDidLeave), state management integration, and React-specific best practices for Ionic apps. Do not use for plain Capacitor React apps without Ionic (use capacitor-react), Ionic with Angular or Vue, creating a new Ionic app (use ionic-app-creation), upgrading Ionic to a newer version (use ionic-app-upgrades), or general Ionic component usage without React-specific context (use ionic-app-development).
Как установить скилл ionic-react?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ionic-react запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic