mirror of
https://github.com/vercel/next.js.git
synced 2026-09-20 02:25:18 +08:00
95acd8b481
This PR updates the with-ionic-typescript example for using the App Router. Here are the changes that have been made: - I renamed the `pages` folder and moved it to the `app` folder. - Added the `layout.tsx` file as part of the App Router. - Updated the `package.json` file. CC: @samcx --------- Co-authored-by: Sam Ko <sam@vercel.com>
31 lines
675 B
TypeScript
31 lines
675 B
TypeScript
"use client";
|
|
|
|
import React, { useEffect } from "react";
|
|
import { defineCustomElements as ionDefineCustomElements } from "@ionic/core/loader";
|
|
|
|
export default function IonicLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
useEffect(() => {
|
|
ionDefineCustomElements(window);
|
|
}, []);
|
|
|
|
return (
|
|
<ion-app>
|
|
<ion-header translucent>
|
|
<ion-toolbar>
|
|
<ion-title>Next.js with Ionic</ion-title>
|
|
</ion-toolbar>
|
|
</ion-header>
|
|
<ion-content fullscreen>{children}</ion-content>
|
|
<ion-footer>
|
|
<ion-toolbar>
|
|
<ion-title>Footer</ion-title>
|
|
</ion-toolbar>
|
|
</ion-footer>
|
|
</ion-app>
|
|
);
|
|
}
|