Display CRUD form even when item is undefined
This commit is contained in:
parent
fcd7a9f56a
commit
ce68048f9e
@ -87,9 +87,9 @@ export class CRUDForm<T> extends React.PureComponent<ICRUDFormProps<T>> {
|
||||
return (
|
||||
<form onSubmit={this.handleSubmit}>
|
||||
<p className='error'>{this.props.error}</p>
|
||||
{!!item && fields.map(field => {
|
||||
{fields.map(field => {
|
||||
const error = this.props.errors[field.name]
|
||||
const value = item[field.name]
|
||||
const value = item ? [field.name] : ''
|
||||
return (
|
||||
<CRUDField<T>
|
||||
id={this.props.id}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user