I want to keep the HTML tag from response in react native
the response from postman:
{
"enable": true,
"faq": [
{
"answer": "<ol>some text</ol>",
"question": "question?"
}
]
}
code in react native are :
doGet(url, additionalHeaders, shouldEncodeURI = true) {
var containAuthorization = (additionalHeaders !== undefined && additionalHeaders.Authorization !== null);
const [headers] = this.generateHeaderBody(null, 'application/json', additionalHeaders);
const encodedUrl = shouldEncodeURI ? encodeURI(url) : url;
const dataObj = {
additionalHeaders,
containAuthorization
};
return new Promise((resolve, reject) => {
fetch(encodedUrl, this.getReqConfig("GET", headers, null)).then(initialResponse => {
console.log('>>> initial ', JSON.stringify(initialResponse));
dataObj['initialResponse'] = initialResponse;
this.responseHandlerGet(url, dataObj, resolve, reject);
}).catch(error => {
if (error && error.status) {
dataObj['initialResponse'] = error;
this.responseHandlerGet(url, dataObj, resolve, reject);
} else {
reject(error);
}
});
});
},
instead of return <ol> some text </ol>
the code returning some text
did my code auto delete the HTML tag? or there is some unusual behavior? or even that is normal?
so if want to keep the html tag is there a way of it?