Skip to content

Commit

Permalink
Merge pull request #16 from iamyuu/fix/pass-props
Browse files Browse the repository at this point in the history
fix: passed props
  • Loading branch information
thejackshelton authored Nov 13, 2023
2 parents 7bb3a0c + 68a7267 commit a48fb94
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
7 changes: 3 additions & 4 deletions apps/astro-demo/src/components/counter.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import { component$,
useSignal } from "@builder.io/qwik";
import { component$, useSignal } from '@builder.io/qwik';

export const Counter = component$(() => {
const counter = useSignal(0);
export const Counter = component$<{ initial: number }>(props => {
const counter = useSignal(props.initial);

return <button onClick$={() => counter.value++}>{counter.value}</button>;
});
2 changes: 1 addition & 1 deletion apps/astro-demo/src/pages/index.astro
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ import { ReactCounter } from "../components/react-counter";
</head>
<body>
<h1>Astro.js - Qwik</h1>
<Counter />
<Counter initial={9} />
</body>
</html>
2 changes: 1 addition & 1 deletion libs/qwikdev-astro/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function renderToStaticMarkup(
slots[key] = value;
}

const app = jsx(Component, { props, slots });
const app = jsx(Component, { ...props, slots });

const symbolMapper: SymbolMapperFn = (
symbolName: string,
Expand Down

0 comments on commit a48fb94

Please sign in to comment.