Skip to content
This repository has been archived by the owner on Sep 27, 2023. It is now read-only.

Use common component declaration style #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const validatedAction = zact(z.object({ stuff: z.string().min(6) }))(
import { validatedAction } from "./action";
import { useZact } from "zact/client";

export const zactTestComponent = () => {
export default function ZactTestComponent() {
const { mutate, data, isRunning } = useZact(validatedAction);

return (
Expand All @@ -38,7 +38,7 @@ export const zactTestComponent = () => {
{data?.message}
</div>
);
};
}
```

### Client WITHOUT custom hook
Expand All @@ -50,7 +50,7 @@ Yes you can just import them and call them like promises too

import { validatedAction } from "./action";

export const zactTestComponent = () => {
export default function ZactTestComponent() {
return (
<div>
<button onClick={() => {
Expand All @@ -60,5 +60,5 @@ export const zactTestComponent = () => {
</button>
</div>
);
};
}
```