jsdf/react-native-htmlview

TypeError: Cannot read property 'style' of undefined

sarkar4540 opened this issue · 4 comments

JSX Code:

<HTMLView value={this.state.test.test.details} />

The following error has occurred.

TypeError: Cannot read property 'style' of undefined
Module.../../../../../../../../../home/sarkar4540/Code/sarkar nigam/magnox/test-system/node_modules/react-native-htmlview/HTMLView.js
node_modules/react-native-htmlview/HTMLView.js:149
  146 | renderNode: PropTypes.func,
  147 | RootComponent: PropTypes.func,
  148 | rootComponentProps: PropTypes.object,
> 149 | style: ViewPropTypes.style,
      | ^  150 | stylesheet: PropTypes.object,
  151 | TextComponent: PropTypes.func,
  152 | textComponentProps: PropTypes.object,
View compiled
__webpack_require__
/home/sarkar4540/Code/sarkar nigam/magnox/test-system/webpack/bootstrap:789
  786 | };
  787 | 
  788 | // Execute the module function
> 789 | modules[moduleId].call(module.exports, module, module.exports, hotCreateRequire(moduleId));
      | ^  790 | 
  791 | // Flag the module as loaded
  792 | module.l = true;
View compiled

same problem

Same problem nearly a year later.

"dependencies": {
    "@expo/webpack-config": "^0.17.0",
    "@react-native-async-storage/async-storage": "~1.17.3",
    "@react-native-picker/picker": "2.4.2",
    "@react-navigation/drawer": "^6.3.1",
    "@react-navigation/native": "^6.0.8",
    "@react-navigation/native-stack": "^6.5.0",
    "axios": "^0.26.1",
    "expo": "^46.0.0",
    "expo-checkbox": "~2.2.0",
    "expo-linear-gradient": "~11.4.0",
    "expo-linking": "~3.2.2",
    "expo-notifications": "~0.16.1",
    "expo-splash-screen": "~0.16.2",
    "expo-status-bar": "~1.4.0",
    "expo-updates": "~0.14.6",
    "formik": "^2.2.9",
    "moment": "^2.29.1",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-native": "0.69.6",
    "react-native-gesture-handler": "~2.5.0",
    "react-native-htmlview": "^0.16.0",
    "react-native-maps": "0.31.1",
    "react-native-reanimated": "~2.9.1",
    "react-native-render-html": "^6.3.4",
    "react-native-safe-area-context": "4.3.1",
    "react-native-screens": "~3.15.0",
    "react-native-web": "~0.18.7",
    "react-native-web-maps": "^0.3.0",
    "yup": "^0.32.11"
  },

HTMLView.js:149 Uncaught TypeError: Cannot read properties of undefined (reading 'style')
at Module../node_modules/react-native-htmlview/HTMLView.js (HTMLView.js:149:1)
at webpack_require (bootstrap:789:1)
at fn (bootstrap:100:1)
at Module../node_modules/react-native-htmlview/index.js (index.js:1:1)
at webpack_require (bootstrap:789:1)
at fn (bootstrap:100:1)
at Module../reactNativeCode/ProfilePage.js (ProfilePage.js:1:1)
at webpack_require (bootstrap:789:1)
at fn (bootstrap:100:1)
at Module../reactNativeCode/SideBarProfileMenu.js (Reciept.js:198:1)
at webpack_require (bootstrap:789:1)
at fn (bootstrap:100:1)
at Module../App.js (bootstrap:856:1)
at webpack_require (bootstrap:789:1)
at fn (bootstrap:100:1)
at Module../node_modules/expo/AppEntry.js (AppEntry.js:1:1)
at webpack_require (bootstrap:789:1)
at fn (bootstrap:100:1)
at Object.1 (SignupPage.js:100:1)
at webpack_require (bootstrap:789:1)
at bootstrap:856:1
at bootstrap:856:1

Issue still exists in web version