useStringField
Field hook to access the data of a configurable field with the type string
.
Arguments
The hook can take an object as argument with the following properties.
Field | Type | Description |
---|---|---|
field | string | The name of the field |
defaultValue | string? | The default value if the field is empty |
Returns
The string
that the user entered.
Example
src/widgets/example/Example.tsx
import React from 'react'
import {useStringField} from '@modbros/dashboard-sdk'
export default function Example() {
const text: string | null = useStringField({field: 'example'})
return null
}