We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Operating System: Platform: linux Arch: x64 Version: #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 Available memory (MB): 63931 Available CPU cores: 12 Binaries: Node: 20.13.1 npm: 10.5.2 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.2.3 // Latest available version is detected (14.2.3). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.4.5 Next.js Config: output: N/A
...
No response
I can not export class and use it with server action...
I would like juste use the classe for OOP mvc for my app!
My file form/action.ts
"use server" export class User{ async changeName(form:FormData) { const name = form.get("name") console.log(name) } }
My page.tsx
`import styles from "./page.module.css"; import {User} from "./form/action"
export default function Home() { const user = new User(); return (
<form action={user.changeName}> <input type="text" name="name"></input> <button type="submit">Change name</button> </form> </div> </main>
); }`
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Verify canary release
Provide environment information
Operating System: Platform: linux Arch: x64 Version: #35~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Tue May 7 09:00:52 UTC 2 Available memory (MB): 63931 Available CPU cores: 12 Binaries: Node: 20.13.1 npm: 10.5.2 Yarn: 1.22.19 pnpm: N/A Relevant Packages: next: 14.2.3 // Latest available version is detected (14.2.3). eslint-config-next: N/A react: 18.3.1 react-dom: 18.3.1 typescript: 5.4.5 Next.js Config: output: N/A
Which example does this report relate to?
...
What browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Describe the Bug
I can not export class and use it with server action...
Expected Behavior
I would like juste use the classe for OOP mvc for my app!
To Reproduce
My file form/action.ts
"use server" export class User{ async changeName(form:FormData) { const name = form.get("name") console.log(name) } }
My page.tsx
`import styles from "./page.module.css";
import {User} from "./form/action"
export default function Home() {
const user = new User();
return (
);
}`
The text was updated successfully, but these errors were encountered: