this is undefined

Hello I am trying to create an action with solidstart but i get the following error. Here is my code:
export default function Test() {
const test = action(async () => {
"use server";
console.log("test");
}, "test");

onMount(() => test());

return <h1>test</h1>;
}
export default function Test() {
const test = action(async () => {
"use server";
console.log("test");
}, "test");

onMount(() => test());

return <h1>test</h1>;
}
No description
3 Replies
REEEEE
REEEEE2w ago
You have to use useAction
Greenman999
Greenman9992w ago
ohhhh thanks