[ad_1]
The person.uid I pulled from the AuthContext and the useContext provides such an error.
Mainly i’ll let the shared submit delete if the userid is the same as the logged in.
however person.uid == submit.userId this isn’t working and it is error :TypeError: null is just not an object (evaluating ‘person.uid’)
repair it ?
import { AuthContext } from "../../Pages/AuthProvider/AuthProvider";
const PostCard = ({submit}) => {
const {person} = useContext(AuthContext);
const userID=person.uid;
return(
<View type={types.container}>
<View type={types.header}>
<View type={types.inner1_container}>
<Picture
type={types.profile_image}
supply={ProfileImg}
/>
<Textual content type={types.username_text}>username</Textual content>
</View>
<View type={types.inner2_container}>
<Textual content type={types.like_text}>Patileyenler: {submit.likes}</Textual content>
<View type={types.like_button}>
<TouchableWithoutFeedback
onPress={preferred}
>
<Picture
type={types.like_button_image}
supply={isLiked ? likedPaw : unLikedPaw}
/>
</TouchableWithoutFeedback>
</View>
</View>
</View>
<View type={types.describe_container}>
<Textual content numberOfLines={8} type={types.describe_text}>{submit.descreption}</Textual content>
{
submit.contact != "" && (<>
<Textual content numberOfLines={2} type={types.contact_text}>{iltetisimtext}{submit.contact} </Textual content>
</>)
}
<Textual content type={types.time_text}>Paylaşma Zamanı</Textual content>
{
person.uid == submit.userId && (<>
<Textual content type={types.time_text}>Delete</Textual content>
</>)
}
</View>
</View>
)
}
[ad_2]
