Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,33 @@ export function InboxPage() {
}
```

### React JSX TypeScript

Importing from `@capgo/capacitor-transitions/react` includes JSX typings for `cap-router-outlet`, `cap-page`, `cap-header`, `cap-content`, and `cap-footer`. In most React projects, that import makes the custom elements valid in TSX automatically.

If TypeScript still reports `Property 'cap-router-outlet' does not exist on type 'JSX.IntrinsicElements'`, add a project declaration file:

```ts
// src/capgo-transitions.d.ts
import '@capgo/capacitor-transitions/react';
```

For Vite, Create React App, and most webpack React apps, placing that file inside `src/` is enough. For Next.js, put it in `src/` or the project root and make sure `tsconfig.json` includes it:

```json
{
"include": ["src", "src/capgo-transitions.d.ts"]
}
```

For custom TypeScript or webpack setups that use a separate `types/` folder, include that folder instead:

```json
{
"include": ["src", "types"]
}
```

## Swipe Back

Enable or disable the iOS edge gesture from markup:
Expand Down
15 changes: 15 additions & 0 deletions apps/web/src/content/plugins-tutorials/en/capacitor-transitions.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,21 @@ export function InboxPage() {
}
```

The React subpath includes JSX typings for the custom elements. If TypeScript still reports that `cap-router-outlet` does not exist on `JSX.IntrinsicElements`, add this file:

```ts
// src/capgo-transitions.d.ts
import '@capgo/capacitor-transitions/react';
```

For Vite, Create React App, and most webpack React apps, keeping that file under `src/` is enough. For Next.js or custom TypeScript setups, make sure it is included by `tsconfig.json`:

```json
{
"include": ["src", "src/capgo-transitions.d.ts"]
}
```

## Enable swipe back

Use `swipe-gesture="auto"` to enable the gesture only when Capacitor reports a native iOS runtime:
Expand Down
27 changes: 27 additions & 0 deletions src/content/docs/docs/plugins/transitions/getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,33 @@ export function InboxPage() {
}
```

### React JSX TypeScript

Importing from `@capgo/capacitor-transitions/react` includes JSX typings for `cap-router-outlet`, `cap-page`, `cap-header`, `cap-content`, and `cap-footer`. In most React projects, that import makes the custom elements valid in TSX automatically.

If TypeScript still reports `Property 'cap-router-outlet' does not exist on type 'JSX.IntrinsicElements'`, add a project declaration file:

```ts
// src/capgo-transitions.d.ts
import '@capgo/capacitor-transitions/react';
```

For Vite, Create React App, and most webpack React apps, placing that file inside `src/` is enough. For Next.js, put it in `src/` or the project root and make sure `tsconfig.json` includes it:

```json
{
"include": ["src", "src/capgo-transitions.d.ts"]
}
```

For custom TypeScript or webpack setups that use a separate `types/` folder, include that folder instead:

```json
{
"include": ["src", "types"]
}
```

## Swipe Back

Enable or disable the iOS edge gesture from markup:
Expand Down
Loading