In my react application I am setting the state value as an array using the below code.
const [ds_data, setDsData] = useState([]);
let ds_arr = res.data.map((elem, index) => {
return elem.split(" ")
})
setDsData(ds_arr)
The values in the array when I use console.log(ds_arr) are
The value I am getting from the server is given below.

The problem is when I try to display the value of the multidimensional array using {ds_data[0][0]}, I am getting the error:
Uncaught TypeError: Cannot read properties of undefined (reading '0')
in the console. When I used {ds_data[0]} it is showing all the array values as a single string:
363861319e9d5720089762a51d24a86dd1402dbba64771c9
The data is displayed inside a bootstrap modal component
The problem was that the state was not set initially, so I have to check if the state was set using the code {Array.isArray(ds_data) && Array.isArray(ds_data[0]) ? ds_data[0][0] : ""}