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
REEEEE8mo ago
You have to use useAction
Greenman999
Greenman999OP8mo ago
ohhhh thanks

Did you find this page helpful?