Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

server-act

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

server-act - npm Package Compare versions

Comparing version 0.0.9 to 0.0.10

6

CHANGELOG.md
# server-act
## 0.0.10
### Patch Changes
- a2ab457: Fixed form action doc
## 0.0.9

@@ -4,0 +10,0 @@

2

package.json
{
"name": "server-act",
"version": "0.0.9",
"version": "0.0.10",
"homepage": "https://github.com/chungweileong94/server-act#readme",

@@ -5,0 +5,0 @@ "repository": {

@@ -104,11 +104,5 @@ # Server-Act

if (formErrors) {
return {
success: false as const,
formErrors: formErrors.formErrors.fieldErrors,
};
return { formErrors: formErrors.formErrors.fieldErrors };
}
return {
success: true as const,
message: `Hello, ${input.name}!`,
};
return { message: `Hello, ${input.name}!` };
});

@@ -124,3 +118,3 @@ ```

export const ClientComponent = () => {
const [state, dispatch] = useFormState(sayHelloAction);
const [state, dispatch] = useFormState(sayHelloAction, { formErrors: {} });

@@ -130,7 +124,7 @@ return (

<input name="name" required />
{state?.formErrors?.name?.map((error) => <p key={error}>{error}</p>)}
{state.formErrors?.name?.map((error) => <p key={error}>{error}</p>)}
<button type="submit">Submit</button>
{!!state?.success && <p>{state.message}</p>}
{!!state.message && <p>{state.message}</p>}
</form>

@@ -137,0 +131,0 @@ );

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc