How Can I Parse SOAP Data in React Native? I need help pls someone help me, i tried, if i write console.log(channels[0]); is output; just {
The contents of the view appear blank on the screen.
constructor(props) {
super(props);
this.state = ({
channels: [],
});
}
componentDidMount() {
axios.post('xxxx', xmls, {
headers: {
'Content-Type': 'text/xml',
Accept: 'application/xml',
},
})
.then((response) => {
const channels = convert.xml2json(response.data, {alwaysArray:true,ignoreAttributes: true, compact: true, ignoreDeclaration: true, fullTagEmptyElement: true, spaces: 4 })
this.setState({ channels: [] })
console.log(channels);
})
.catch(err => console.log(err));
}
render() {
return (
<View>
{this.channels.map((v, id) => {
<View key={id}>{v.item}</View>
})}
</View>
)
}
}