Answer the question
In order to leave comments, you need to log in
What is the correct way to encapsulate inside a React component?
There is a component
return (
<div className={classNames}>
<img
className={[classes["user__avatar"]]}
alt={props.altAvatar}
src={props.srcAvatar}
/>
<h1 className={[classes["user__name"]]}>{props.userName}</h1>
<Button className={[classes["user__logout"]]} onClick={logOut}>
Logout
</Button>
</div>
<UserProfile
className={[classesAppContainer["app__body"]]}
userName={userProfileName}
alt={userProfileName}
src={userProfilePhoto}
/>
Answer the question
In order to leave comments, you need to log in
1. I would try to wrap withUser in HOC or make a hook of the same name
2. In general, this is normal. A normal component that renders what is given to it.
3. Make it smarter so that it receives this data itself. Here it echoes with paragraph 1
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question