Web UIKit v3.0 Migration Guide
Major breaking changes
@amityco/js-sdk is no longer support
The UIKit is now based on @amityco/ts-sdk is no longer support
TypeScript support for Social/Chat Components
remove children component as a function, render-props
drop props-types support
custom components config and post renderer config have been changed from
to
Deprecated functions
components
FileUploader [src/core/components/Uploaders/Uploader.jsx]
use useFileUpload instead
LoadMore [src/social/components/LoadMore/index.jsx]
use LoadMoreWrapper instead
hoc
withSize [src/core/hocs/withSize.jsx]
useSize instead
withSDK [src/core/hocs/withSDK.jsx]
useSDK instead
hooks
useAsyncCallback [src/core/hooks/useAsyncCallback.ts]
useElement [src/core/hooks/useElement.ts]
is equivalent to
useFollow [src/core/hooks/useFollow.ts]
for isFollowNone, isFollowAccepted, isFollowPending it can be replaced by useFollowStatus like this
for follow, followAccept, followDecline, deleteFollower just call a UserRepository.Relationship directly
useCommentLike [src/social/hooks/useCommentLike.js] it can be replaced like this
useCommunityMembers [src/social/hooks/useCommunityMembers.ts]
useCommunityOneMember [src/social/hooks/useCommunityOneMember.ts]
usePostChildren [src/social/hooks/usePostChildren.ts]
use usePostByIds instead
usePostLike [src/social/hooks/usePostLike.ts]
useReport [src/social/hooks/useReport.ts]
use useUserFlaggedByMe instead
useChannelMembers [src/chat/hooks/useChannelMembers.ts] -> useChannelMembersCollection
return values [channelMembers, hasMore, loadMore] to {channelMembers, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useChannels [src/chat/hooks/useChannels.ts] -> useChannelsCollection
return values [channels, hasMore, loadMore] to {channels, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useMessages [src/chat/hooks/useMessages.ts] -> useMessagesCollection
return values [messages, hasMore, loadMore] to {messages, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useAllUsers [src/core/hooks/useAllUsers.ts] -> useAllUsersCollection
return values [users, hasMore, loadMore] to {users, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useFollowers [src/core/hooks/useFollowers.ts] -> useFollowersCollectionCollection
return values [followers, hasMore, loadMore] to {followers, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useFollowings [src/core/hooks/useFollowings.ts] -> useFollowingsCollectionCollection
return values [followings, hasMore, loadMore] to {followings, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useUserQuery [src/core/hooks/useUserQuery.ts] -> useUsersCollection
return values [users, hasMore, loadMore] to {users, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useCategories [src/social/hooks/useCategories.ts] -> useCategoriesCollection
return values [categories, hasMore, loadMore] to {categories, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useCommunities [src/social/hooks/useCommunities.ts] -> useCommunitiesCollection
return values [communities, hasMore, loadMore] to {communities, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useMedia [src/social/hooks/useMedia.ts] -> useMediaCollection
return values [media, hasMore, loadMore] to {media, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
usePosts [src/social/hooks/usePosts.ts] -> usePostsCollection
return values [posts, hasMore, loadMore] to {posts, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useRecommendedCommunities [src/social/hooks/useRecommendedCommunities.ts] -> useRecommendedCommunitiesCollection
return values [posts, hasMore, loadMore] to {posts, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useTrendingCommunities [src/social/hooks/useTrendingCommunities.ts] -> useTrendingCommunitiesCollection
return values [posts, hasMore, loadMore] to {posts, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
functions
isEmpty [src/helpers/isEmpty.js] just use javascript equal syntax instead
isEqual [src/helpers/isEqual.js] just use javascript equal syntax instead
isPostModerator [src/helpers/utils.ts] use usePostPermission instead
canEditCommunity [src/helpers/utils.ts] use usePostPermission instead
canDeletePost [src/helpers/utils.ts] use usePostPermission instead
canEditPost [src/helpers/utils.ts] use usePostPermission instead
canReportPost [src/helpers/utils.ts] use usePostPermission instead
promisify [src/helpers/promisify.ts]
stripUndefinedValues [src/helpers/utils.ts]
Breaking changes functions
Opcomponents
CommentList [src/social/components/CommentList/index.tsx]
props filterByParentId is removed
hooks
useFollowStatus [src/core/hooks/useFollowStatus.ts]
parameters (sourceUserId, targetUserId) to (sourceUserId)
useChannelMembers [src/chat/hooks/useChannelMembers.ts]
parameters (channelId, memberCount) to (channelId)
return values [members, hasMore, loadMore] to {channelMembers, isLoading, loadMore, hasMore, loadMoreHasBeenCalled }
useCommentsQuery [src/core/hooks/useCommentsQuery] -> useCommentsCollection
parameters
limit has been added
first and last have been removed
useCommunity [src/core/hooks/useCommunity]
parameters resolver has been removed
return values
to
Last updated