'Proble to load the local html content in react native project after build generation
I'm trying to load local html content in my react native project that is properly working on development but the content is not loading after build generated what can i do? Using packages are
"@react-native-picker/picker": "2.2.1",
"@react-navigation/bottom-tabs": "^6.3.1",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.5.0",
"@reduxjs/toolkit": "^1.8.1",
"babel-plugin-inline-dotenv": "^1.7.0",
"expo": "~44.0.0",
"expo-asset": "~8.4.6",
"expo-document-picker": "^10.1.3",
"expo-font": "~10.0.4",
"expo-image-manipulator": "~10.2.0",
"expo-location": "~14.0.1",
"expo-print": "~11.1.0",
"expo-sharing": "~10.1.0",
"expo-updates": "~0.11.6",
"formik": "^2.2.9",
"react": "17.0.1",
"react-dom": "17.0.1",
"react-native": "0.64.3",
"react-native-autocomplete-input": "^5.1.0",
"react-native-dotenv": "^3.3.1",
"react-native-elements": "^3.4.2",
"react-native-global-font": "^1.0.3",
"react-native-global-props": "^1.1.5",
"react-native-paper": "^4.11.2",
"react-native-render-html": "^6.3.4",
"react-native-safe-area-context": "3.3.2",
"react-native-screens": "~3.10.1",
"react-native-vector-icons": "^9.1.0",
"react-native-web": "0.17.1",
"react-redux": "^8.0.0",
"yup": "^0.32.11"
**this is my code **
import HTML from "react-native-render-html";
<HTML
renderers={{
img: (attribs) => {
const imagePath = attribs.source;
return (
<Image
key={attribs.source}
style={styles.imageContainer}
source={require("./invoiceIcon.png")}
/>
);
},
}}
source={{ html,uri:require("../../../assets/InvoiceHtml") }}
contentWidth={contentWidth}
emSize={0.8}
classesStyles={{ ...template }} //these are styles for pdf that is visible on screen
/>
sample invoiceHtml.js is
export default invoice(){
return (`sample html content`)
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
