
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@location-state/conform
Advanced tools
@location-state/conformSynchronize conform with history entries.
@location-state/core docs.npm install @location-state/core @location-state/conform
# or
yarn add @location-state/core @location-state/conform
# or
pnpm add @location-state/core @location-state/conform
// src/app/Providers.tsx
"use client";
import { LocationStateProvider } from "@location-state/core";
export function Providers({ children }: { children: React.ReactNode }) {
return <LocationStateProvider>{children}</LocationStateProvider>;
}
// src/app/layout.tsx
import { Providers } from "./Providers";
// ...snip...
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en">
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}
// user-form.tsx
"use client";
import { getInputProps, useForm } from "@conform-to/react";
import { parseWithZod } from "@conform-to/zod/v4"; // Or, if you use zod@v3, import `@conform-to/zod`.
import { useLocationForm } from "@location-state/conform";
import { useFormState } from "react-dom";
import { User } from "./schema"; // Your schema
export default function UserForm() {
const [formOptions, getLocationFormProps] = useLocationForm({
location: {
name: "your-form", // Unique form name
storeName: "session", // or "url"
},
});
const [form, fields] = useForm({
onValidate({ formData }) {
return parseWithZod(formData, { schema: User });
},
...formOptions, // Pass the form options from `useLocationForm`
});
return (
// Use `getLocationFormProps` to get the form props
<form {...getLocationFormProps(form)} noValidate>
<label htmlFor={fields.firstName.id}>First name</label>
<input
{...getInputProps(fields.firstName, {
type: "text",
})}
key={fields.firstName.key}
/>
<div>{fields.firstName.errors}</div>
<button type="submit">submit</button>
</form>
);
}
// action.ts
"use server";
import { parseWithZod } from "@conform-to/zod/v4"; // Or, if you use zod/v3, import `@conform-to/zod`.
import { redirect } from "next/navigation";
import { User } from "./schema";
export async function saveUser(prevState: unknown, formData: FormData) {
const submission = parseWithZod(formData, {
schema: User,
});
if (submission.status !== "success") {
return submission.reply();
}
console.log("submit data", submission.value);
redirect("/success");
}
// user-form.tsx
"use client";
import { getInputProps, useForm } from "@conform-to/react";
import { parseWithZod } from "@conform-to/zod/v4"; // Or, if you use zod@v3, import `@conform-to/zod`.
import { useLocationForm } from "@location-state/conform";
import { useFormState } from "react-dom";
import { saveUser } from "./action"; // Your action
import { User } from "./schema"; // Your schema
export default function UserForm() {
const [lastResult, action] = useFormState(saveUser, undefined);
const [formOptions, getLocationFormProps] = useLocationForm({
location: {
name: "your-form", // Unique form name
storeName: "session", // or "url"
},
});
const [form, fields] = useForm({
lastResult,
onValidate({ formData }) {
return parseWithZod(formData, { schema: User });
},
...formOptions, // Pass the form options from `useLocationForm`
});
return (
// Use `getLocationFormProps` to get the form props
<form {...getLocationFormProps(form)} action={action} noValidate>
<label htmlFor={fields.firstName.id}>First name</label>
<input
{...getInputProps(fields.firstName, {
type: "text",
})}
key={fields.firstName.key}
/>
<div>{fields.firstName.errors}</div>
<button type="submit">submit</button>
</form>
);
}
View the API reference here.
FAQs
Synchronize `conform` with history entries.
The npm package @location-state/conform receives a total of 12 weekly downloads. As such, @location-state/conform popularity was classified as not popular.
We found that @location-state/conform demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.