Why are error show in react js this error show Cannot read properties of undefined (reading 'length').
export function Stricks1_(props){
const Healthcares = props.names
return (
<>
<h3> There Waiting List {Healthcares.length} </h3>
</>
)
}
const Healthcare = [1,2,3]
const root=reactDom.createRoot(document.getElementById("root"));
root.render(<Stricks1_ names={Healthcare}/>)
Top comments (1)
try changing it to
Healthcare.length