Omission of AsyncDataSource nodes in v 4.10.0 #1158
-
Hi, working on transitioning from version 4.8.5 to 4.10.0 and have a bit of code that goes as such const positionDataSource = useAsyncDataSource({api: "ApiStuff" , getId: () => value});
const remotePosition = positionsDataSource.nodes.find(
(node) => node.item.label === selectedTeamMemberForEdit.position
)?.item.value;
This is a three-parter. What was the original purpose of the dataSource.nodes property, why was it removed? and if it's under some new structure, how should i approach similar logic? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi, |
Beta Was this translation helpful? Give feedback.
Hi,
nodes
was an internal property which now migrated to the new Tree approach. Now you can use -positionDataSource.tree.getRootItems()
, but for now it's also not stable and public api. So it's better to just set items which you receive in api call to some variable(e.g. useRef) and then use it directly.