小编S.H*_*hmi的帖子

未为 IOS 安装 React Native Fetch Blob 问题 pod

使用 React Native Fetch Blob 执行一些操作。但是IOS平台没有安装在pod文件中。显示这个...

[!] CocoaPods could not find compatible versions for pod "React/Core":
  In Podfile:
    react-native-fetch-blob (from `../node_modules/react-native-fetch-blob`) was resolved to 0.10.6, which depends on
      React/Core

None of your spec sources contain a spec satisfying the dependency: `React/Core`.

You have either:
 * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`.
 * mistyped the name or version.
 * not added the source repo that hosts the Podspec to your Podfile. …
Run Code Online (Sandbox Code Playgroud)

cocoapods react-native

9
推荐指数
1
解决办法
6125
查看次数

导航在React Native中的axios调用中不起作用

我正在axiosReact Native中使用发帖请求来执行登录用户功能。我成功获得响应,但是登录后我无法导航到主屏幕。这是我的代码。

axios.post('/wp-json/api/v1/user/do_login', {
        username: username,
        password: password
          })
          .then(function (response) {
              console.log(JSON.stringify(response.data.type));
              if(response.data.type == "success"){
                alert("Login Successfully");
                this.props.navigation.navigate("home");
              }else if(response.data.type == "error"){
                alert("Incorrect Detail");
              }


          })
          .catch(function (error) {
            console.log( JSON.stringify(response));
          });
Run Code Online (Sandbox Code Playgroud)

在上面的代码中,我获得了成功的响应,但没有得到下一个屏幕。这是我导航到下一个屏幕..

this.props.navigation.navigate("home");
Run Code Online (Sandbox Code Playgroud)

reactjs react-native axios

0
推荐指数
1
解决办法
270
查看次数

标签 统计

react-native ×2

axios ×1

cocoapods ×1

reactjs ×1