my parrent Comments components have one single comment
this is Comments
part of the code
{sort === 'recent' &&
sortByRecent.length > 0 &&
sortByRecent.map((item, index) => {
return (
<CommentUnit
gradeUI={props.gradeUI}
key={`${item.id}commentOf${props.commentType}Recent`}
item={item}
writable={props.writable}
handlePressCommentInputButton={handlePressCommentInputButton}
handleCollapse={handleCollapse}
handleMoveProfile={props.handleMoveProfile}
getRecomment={() => {
props.commentType === 'notice' && handleAPI11_16(item.id);
props.commentType === 'gathering-feed' &&
handleAPI10_14(item.id);
props.commentType === 'personal-feed' &&
handle3_14(item.id);
props.commentType === 'schedule' && handleAPI9_24(item.id);
}}
commentType={props.commentType}
/>
);
})}
and here is SingleComments
part of the code
<CustomPressable
style={[styles.flexDirectionRow]}
onPress={moveProfile}>
<View style={[styles.authorImageWrapper, {borderWidth: 1}]}>
<FastImage
style={[styles.imageSize, styles.circleImageSize]}
source={item.author.image ? {uri: item.author.image} : IMAGE.user}
/>
{gradeUI &&
item.author.grade != undefined &&
item.author.grade != '일반' && (
<View style={styles.stickerImageWrapper}>
<FastImage
style={styles.circleImageSize}
source={
item.author.grade === '모임장'
? IMAGE.il_dotCrownBadge
: item.author.grade === '정회원'
? IMAGE.il_starBadge
: IMAGE.il_crownBadge
}
/>
</View>
)}
</View>
<Text style={[styles.authorNicknameText, {borderWidth: 1}]}>
{item.author.nickname}
{item.author.id}
</Text>
</CustomPressable>
I created logic that moves to the profile when the onPress function is pressed, but onPress itself is not called in some components.
enter image description here
This is an example of an issue.
When you press the first one, the moveProfile function is executed, but the second one has no response.
it is irregular and sometimes everything works fine.
1