Skip to content Skip to sidebar Skip to footer

React Native: I Getting Raw Data In Display Page

I'm trying to display staff_name in my dashboard page. The data is displaying but it's displaying raw. Can I know how to solve it. API code(fetch URL) method: 'GET',

Solution 1:

have you try to use WebView instead of Text something like this :

<WebViewstyle={[components.titleTextStyle]}html={item.staff_name}/>

https://reactnative.dev/docs/webview.html#html

Solution 2:

First of all why are you getting the whole component from api this is not the suggested pattern. You cannot render html inside react-native if you pass string to component it will treat it as string only not any component

You can get props like url , type etc from the api and render the component youself in react-native with all business logic in component only

Post a Comment for "React Native: I Getting Raw Data In Display Page"