Next.js Discord

Discord Forum

Typescript and Server Actions

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
So evidently I can't simply pass custom class data types as parameters to server actions because they have to be either plain JS objects or one of a few built-ins. Am I doing something very wrong in how I'm using Typescript with Next.js or am I supposed to serialize/deserialize my custom class types into strings with JSON.stringify()/JSON.parse() just to get the parameters through the server action doors?

0 Replies