I am trying to display a React form as a table using react-jsonschema-form-extras and get the following error:
"TypeError: Cannot read property 'tableCols' of undefined"
I am creating a React form using react-jsonschema-form and react-jsonschema-form-extras. All the features work perfectly for me except ""ui:field": "table"". See GitHub documentation.
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"
]
}
According to the docs, you can use table without any additional predefined configuration. I also tried defining the table column:
const uSchema = {
"listOfStrings": {
"ui:field": "table",
"table": {
"tableCols": [
{
"dataField": "listOfStrings"
}
]
}
}
}
Results in the folowing error:
"TypeError: Cannot convert undefined or null to object"