我是 React 的初学者。我正在尝试将"LicType"
下图中描述的状态对象的属性显示为文本字段的值。
现在有 searchJsonsearchJson:"random text here"
<TextField
value={values.searchJson}/>
如果searchJson 没有像那样嵌套,我会使用。
如何显示或访问LicType
, nextOfKin
, 或accountNotes
作为文本字段的值?
注意:values
通过道具传递。
编辑
Values.searchJson[0].LicType 生成以下错误
TypeError: Cannot read property 'fname' of undefined