0

I'm new to React native, I tried calling:

fetch('https://rallycoding.herokuapp.com/api/music_albums')
    .then((response) => response.json())
    .then((responseData) => {
      console.log(`TEST RESPONSE: ${responseData}`);
    });

to fetch the API and log it to debug. I expected to see the details of the result just like in the tutorial but instead, I got the output like:

TEST RESPONSE: [object Object],[object Object],[object Object],[object Object],[object Object]

It's supposed to be somehow like this, where I can expand the data to see the array: enter image description here

However, the result can be used and being populated into the list normally.

I am using

react-native-cli: 2.0.1

react-native: 0.56.0

What did I do wrong? Thank you for your time.

1 Answer 1

2

You have to print it with console.log('TEST RESPONSE:', responseData)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.