1
0
mirror of https://gitlab.nic.cz/turris/reforis/foris-js.git synced 2025-09-19 02:02:13 +02:00

docs: Fix code snippets syntax highlighting & some refactoring

This commit is contained in:
Aleksandr Gumroian
2025-04-17 17:13:54 +02:00
parent d6fda7d732
commit 69b1b38202
18 changed files with 171 additions and 160 deletions

View File

@@ -6,26 +6,30 @@ comfort API and allows to create typical Foris module forms easily.
You can pass more forms as children.
```js
<ForisForm
ws={ws}
forisConfig={{
endpoint: API_URLs.wan,
wsModule: "wan",
}}
prepData={prepData}
prepDataToSubmit={prepDataToSubmit}
validator={validator}
>
<WANForm />
<WAN6Form />
<MACForm />
</ForisForm>
```jsx static
export default function WAN({ ws }) {
return (
<ForisForm
ws={ws}
forisConfig={{
endpoint: API_URLs.wan,
wsModule: "wan",
}}
prepData={prepData}
prepDataToSubmit={prepDataToSubmit}
validator={validator}
>
<WANForm />
<WAN6Form />
<MACForm />
</ForisForm>
);
}
```
### Example of children forms `props` usage
```js
```jsx static
export default function MACForm({
formData,
formErrors,
@@ -64,9 +68,9 @@ export default function MACForm({
}
```
The <ForisForm/> passes subsequent `props` to the child components.
The `<ForisForm/>` passes subsequent `props` to the child components.
| Prop | Type | Description |
| Prop name | Type | Description |
| -------------- | ------ | -------------------------------------------------------------------------- |
| `formData` | object | Data returned from API. |
| `formErrors` | object | Errors returned after validation via validator. |