+-
获取Stream IO React Native UnFollowing选项不可用。

我在我的项目中使用Get Stream Io react native。https:/github.comGetStreamreact-native-activity-feed。

我看到库里有一个功能,可以关注某个特定的用户,而相反的功能却没有,即如何做到 取消关注 一个用户。

请指点我如何在react native中实现这个功能。

0
投票

我们的库中没有包含关注unfollowing的逻辑。不过它有一个按钮可以让你自己设置。哪个是 FollowButton 你在说什么?你可以做这样的事情。

<FollowButton
  followed={async () => {
    // check if you're following the user
    const following = await your_timeline_feed.following({filter: ['user:user_42'] })
    if (following) {
      return true;
    }
    return false;
  }} // renders the button as "following"

  clicked={async () => {
    // your logic for following/unfollowing
    await your_timeline_feed.follow('user', 'user_42');
  }}
/>

在这里阅读更多。

https:/getstream.github.ioreact-native-activity-feed#!FollowButton。 https:/getstream.iodocsfollowing?language=js。