如何从 GET api React-Native-Fetch-blob 添加复选框列表



我想从 GET API React-Native-Fetch-Blob 添加复选框列表数据。 有什么解决方案吗?

这是我的代码复选框

class....{
 constructor(props) {
    super(props);
    this.state = {
    name: false,
  };
}
render(){
  return(
   <CheckBox checked={this.state.name}/>
      <Text style={{marginLeft: 20}}>List Checkbox 1</Text>
  );
 }
}

以下是从 fetchBlob 获取数据的一种方法:

RNFetchBlob.fetch('GET', 'API', {
    Authorization : 'access-token',
    // more headers  ..
  })
  // when response status code is 200
  .then((res) => {
    let json = res.json()
  })
  // Status code is not 200
  .catch((errorMessage, statusCode) => {
    // error handling
  })

完成所有这些后,将数据传递到复选框。

干杯:)

最新更新