Skip to content

Commit 4dbf4e6

Browse files
committed
chore: update demo & templates
1 parent 92ca50f commit 4dbf4e6

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

demo/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "./App.css";
3-
import { Head } from "@impalajs/react/head";
3+
import { Head, HeadProvider } from "@impalajs/react/head";
44

55
interface AppProps {
66
title: string;
@@ -11,12 +11,12 @@ export const App: React.FC<React.PropsWithChildren<AppProps>> = ({
1111
title,
1212
}) => {
1313
return (
14-
<>
14+
<HeadProvider>
1515
<Head>
1616
<title>{title}</title>
1717
<meta name="description" content="This is a demo" />
1818
</Head>
1919
{children}
20-
</>
20+
</HeadProvider>
2121
);
2222
};

templates/preact-js/src/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import "./App.css";
2-
import { Head } from "@impalajs/preact/head";
2+
import { Head, HeadProvider } from "@impalajs/preact/head";
33

44
export const App = ({ children, title }) => {
55
return (
6-
<>
6+
<HeadProvider>
77
<Head>
88
<title>{title}</title>
99
</Head>
1010
{children}
11-
</>
11+
</HeadProvider>
1212
);
1313
};

templates/preact-ts/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import "./App.css";
2-
import { Head } from "@impalajs/preact/head";
2+
import { HeadProvider, Head } from "@impalajs/preact/head";
33
import { FunctionComponent } from "preact";
44

55
interface AppProps {
@@ -8,11 +8,11 @@ interface AppProps {
88

99
export const App: FunctionComponent<AppProps> = ({ children, title }) => {
1010
return (
11-
<>
11+
<HeadProvider>
1212
<Head>
1313
<title>{title}</title>
1414
</Head>
1515
{children}
16-
</>
16+
</HeadProvider>
1717
);
1818
};

templates/react-js/src/App.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React from "react";
22
import "./App.css";
3-
import { Head } from "@impalajs/react/head";
3+
import { Head, HeadProvider } from "@impalajs/react/head";
44

55
export const App = ({ children, title }) => {
66
return (
7-
<>
7+
<HeadProvider>
88
<Head>
99
<title>{title}</title>
1010
</Head>
1111
{children}
12-
</>
12+
</HeadProvider>
1313
);
1414
};

templates/react-ts/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import "./App.css";
3-
import { Head } from "@impalajs/react/head";
3+
import { Head, HeadProvider } from "@impalajs/react/head";
44

55
interface AppProps {
66
title: string;
@@ -11,11 +11,11 @@ export const App: React.FC<React.PropsWithChildren<AppProps>> = ({
1111
title,
1212
}) => {
1313
return (
14-
<>
14+
<HeadProvider>
1515
<Head>
1616
<title>{title}</title>
1717
</Head>
1818
{children}
19-
</>
19+
</HeadProvider>
2020
);
2121
};

0 commit comments

Comments
 (0)