I'm new to react and I'm trying to separate the component. Are the following examples containers or components? For me both are components but I'm not sure because they have Link tag and Route tag.
Page.jsx
<main role="application">
<Switch>
{/* Home */}
<Route path="/" exact component={Home} />
{/* Profile */}
<Route path="/user/:id" exact component={Profile} />
{/* Error 404 */}
<Route component={Error404} />
</Switch>
</main>
User.jsx:
function User(props) {
return (
<div id={`user-${props.id}`}>
<Link to={`/user/${props.id}`}>
{props.name}
</Link>
<p>{props.email}</p>
</div>
);
}
User.propTypes = {
id: PropTypes.number.isRequired,
name: PropTypes.string.isRequired,
email: PropTypes.string.isRequired,
};
export default User;