Answer the question
In order to leave comments, you need to log in
How to access the field of an object in React if it comes as a response from the backend and is initially an empty object?
item is an object that is empty at the time of rendering, so it does not yet have a parentNode field, so an error is immediately thrown
renderValue={(value, item, selectedElement) => {
console.log(`${item.parentNode.label} ${selectedElement}`)
}}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question