Files
vercel__next.js/examples/with-ionic/_components/IonicLayout.tsx
PapatMayuri 95acd8b481 updated with-ionic-typescript example to utilize the App Router. (#73418)
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>
2024-12-10 05:37:13 +00:00

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>
);
}