MCPcopy Create free account
hub / github.com/alpha2phi/python-apps / useFormFields

Function useFormFields

graphql-ml-serving/frontend/src/libs/hooksLib.js:3–15  ·  view source on GitHub ↗
(initialState)

Source from the content-addressed store, hash-verified

1import { useState } from "react";
2
3export function useFormFields(initialState) {
4 const [fields, setValues] = useState(initialState);
5
6 return [
7 fields,
8 function (event) {
9 setValues({
10 ...fields,
11 [event.target.id]: event.target.value,
12 });
13 },
14 ];
15}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected