diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-03-07 10:01:29 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-03-07 10:01:29 +0100 |
commit | 570cd03a8a39605fe667067cc0b84701e441c680 (patch) | |
tree | 3091f069e9492dcf7c63d23de1543261c0a1ab4e /design-documents/054-dynamic-form.rst | |
parent | e39dd668c013a44854d8b9fd62b486a90f6931b9 (diff) | |
download | docs-570cd03a8a39605fe667067cc0b84701e441c680.tar.gz docs-570cd03a8a39605fe667067cc0b84701e441c680.tar.bz2 docs-570cd03a8a39605fe667067cc0b84701e441c680.zip |
-fix build issues
Diffstat (limited to 'design-documents/054-dynamic-form.rst')
-rw-r--r-- | design-documents/054-dynamic-form.rst | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/design-documents/054-dynamic-form.rst b/design-documents/054-dynamic-form.rst index 6ff84d41..d93b3684 100644 --- a/design-documents/054-dynamic-form.rst +++ b/design-documents/054-dynamic-form.rst @@ -51,7 +51,7 @@ readOnly (flag to disable input), onUpdate (callback on form data update), and computeFormState (function to derive the form state based on current data). -.. code-block:: javascript +.. code-block:: typescript interface FormType<T extends object> { value: Partial<T>; @@ -82,7 +82,7 @@ The field type ``AmountJson`` and ``AbsoluteTime`` are opaque since field is use The form can be instanciated using -.. code-block:: javascript +.. code-block:: typescript import { FormProvider } from "@gnu-taler/web-util/browser"; @@ -90,7 +90,7 @@ The form can be instanciated using Then the field component can access all the properties by the ``useField(name)`` hook, which will return -.. code-block:: javascript +.. code-block:: typescript interface InputFieldHandler<Type> { value: Type; @@ -116,10 +116,10 @@ A set of common form field exist in ``@gnu-taler/web-util``: and should be used inside a ``Form`` context. -.. code-block:: javascript +.. code-block:: none function MyFormComponent():VNode { - return <FormProvider > + return <FormProvider> <InputAmount name="amount" /> <InputText name="subject" /> <button type="submit"> Confirm </button> @@ -132,7 +132,7 @@ Example Consider a form shape represented by the TypeScript type: -.. code-block:: javascript +.. code-block:: typescript type TheFormType = { name: string, @@ -148,7 +148,7 @@ Consider a form shape represented by the TypeScript type: An example instance of this form could be: -.. code-block:: javascript +.. code-block:: typescript const theFormValue: TheFormType = { name: "Sebastian", |