I’m getting the error above trying to get comments using the TS SDK in react native. My code is below which seems correct…?
const unSubscribe = CommentRepository.getComments(
{
referenceType,
referenceId,
},
({ data: comments, onNextPage, hasNextPage, loading, error }) => {
if (error) {
setError(error);
}
if (loading) {
setLoading(true);
}
if (comments) {
setComments(comments);
}
setHasMore(hasNextPage);
prevNextPageFn.current = onNextPage;
},
);