Consistently getting TypeError: Cannot read property 'title' of undefined when trying to load of my page. I am certain its related to my props but cannot figure what I am doing wrong.
I've tried going through every single prop and editing it but I continue to get the same error just for the next "person title" after.
import React from "react";
const Personcard = props => {
const handleUpdate = () => {
props.handleEdit(props.person.id);
};
return (
<div className="container">
<div className="containerUsers">
<div className="card">
<img
// src={props.person.primaryImage.imagineUrl}
id="primaryImageUsers"
alt=""
/>
<div className="card-body">
<div className="card-title">
<h2>
{props.person.title === "Mr" && (
<span id="titleUsers"> {props.person.title}</span>
)}
</h2>
</div>
</div>
<div className="card-text">
<h4>
<span id="headlineUsers" value={props.person.headline}>
{" "}
</span>
</h4>
<p>
<span id="summaryUsers" value={props.person.summary}>
{" "}
</span>
</p>
<p>
<span value={props.person.skills}> </span>
</p>
</div>
<button
type="button"
className="btn btn-warning"
onClick={handleUpdate}
>
{" "}
Update{" "}
</button>
<button type="button" className="btn btn-danger">
Delete
</button>
</div>
</div>
</div>
);
};
My goal is to display registered users on a homepage.
<Personcard>? It would be good to see how you're passing in thepersonprop. - helloitsjoe