Skip to main content

useNumberField

Field hook to access the data of a configurable field with the type number.

Arguments

The hook can take an object as argument with the following properties.

FieldTypeDescription
fieldstringThe name of the field
defaultValuenumber?The default value if the field is empty

Returns

The number that the user entered.

Example

src/widgets/example/Example.tsx
import React from 'react'
import {useNumberField} from '@modbros/dashboard-sdk'

export default function Example() {
const someNumber: number | null = useNumberField({field: 'example'})

return null
}