0

i want to add checkbox list data from GET API React-Native-Fetch-Blob. have any solution?

this is my code checkbox

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

1 Answers1

1

Following is a way to fetch data from 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
  })

After all this pass data to the checkbox..

Cheers :)

Codesingh
  • 3,316
  • 1
  • 11
  • 18