DEV Community

ankit3131
ankit3131

Posted on

Cannot read properties of undefined (reading 'length')

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)

Collapse
 
mellen profile image
Matt Ellen

try changing it to Healthcare.length