I have successfully called and passed the token to my API endpoint. However, I do not need both objects. I just want to work with the first index in the array that has fields. So I would like to retrieve all the details and print them out in the browser but for now all what can be printed is ID and type

I have tried filtering through the data array but it did not work.
var config = {
headers: {'Authorization': 'Bearer token'}
};
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
data: [],
}
}
componentDidMount() {
axios.get('https://api.transferwise.com/v1/profiles',config)
.then(response => {
if (response.status === 200 && response != null) {
this.setState({
data: response.data
});
} else {
console.log('problem');
}
})
.catch(error => {
console.log(error);
});
}
render() {
const { data } = this.state;
return (
<div >
{this.state.data.map(object => (
<p key={object.uid}>{object.id} {object.type}</p>
))}
</div>
)
}};
export default App;
Array#find. developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…this.state.datato be. If you want it to be just the first name,this.setState({ data: response.data[0].details.firstName }).