Я пытаюсь отобразить форму React в виде таблицы с помощью response-jsonschema-form-extras и получаю следующую ошибку:
"TypeError: Cannot read property 'tableCols' of undefined"
Я создаю форму React, используя react-jsonschema-form и react-jsonschema-form-extras. У меня все функции работают отлично, кроме "" ui: field ":" table "". См. документацию GitHub. а>
const schema = {
"type": "object",
"properties": {
"listOfStrings": {
"type": "array",
"title": "A list of strings",
"items": {
"type": "string",
"default": "bazinga"
}
}
}
}
const uiSchema = {
"listOfStrings": {
"ui:field": "table"
}
}
const formData = {
"listOfStrings": [
"foo",
"bar"
]
}
Согласно документации, вы можете использовать таблицу без какой-либо дополнительной предопределенной конфигурации. Я также попытался определить столбец таблицы:
const uSchema = {
"listOfStrings": {
"ui:field": "table",
"table": {
"tableCols": [
{
"dataField": "listOfStrings"
}
]
}
}
}
Приводит к следующей ошибке:
"TypeError: Cannot convert undefined or null to object"