React-native-render-html: ViewStylesPropTypes and ImageStylesPropTypes deprecated in RN 0.58

Created on 16 Jan 2019  路  6Comments  路  Source: meliorence/react-native-render-html

Is this a bug report or a feature request?

Bug report

Have you read the guidelines regarding bug report?

Yes

Have you read the documentation in its entirety?

Yes

Have you made sure that your issue hasn't already been reported/solved?

Yes

Is the bug specific to iOS or Android? Or can it be reproduced on both platforms?

N/A

Is the bug reproductible in a production environment (not a debug one)?

Yes

Have you been able to reproduce the bug in the provided example?

No

Environment

Environment:
"react": "16.6.3",
"react-native": "0.58.0-rc.2",
"react-native-render-html": "^3.10.0"

Target Platform:
N/A

Steps to Reproduce

react-native-render-html makes the app fail at runtime because it cannot find imports ViewStylesPropTypes nor ImageStylesPropTypes (in HTMLUtils.js).

React Native 0.58.0-rc.2 has deprecated both ViewStylesPropTypes and ImageStylesPropTypes,
but they can still be used importing like so in HTMLUtils.js:

import ViewStylesPropTypes from 'react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes';
import ImageStylesPropTypes from 'react-native/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes';

Expected Behavior

App should work with React Native 0.58.0

Actual Behavior

error: bundling failed: Error: Unable to resolve module react-native/Libraries/Image/ImageStylePropTypes from /home/xipgroc/workspace/XipgrocApp/node_modules/react-native-render-html/src/HTMLUtils.js: Module react-native/Libraries/Image/ImageStylePropTypes does not exist in the Haste module map

Most helpful comment

PR #201

All 6 comments

PR #201

When I try to deploy a project, I still have this problem. Can someone help?
Full Environment:
"dependencies": {
"axios": "^0.18.0",
"lru-memoize": "^1.0.2",
"prop-types": "^15.6.2",
"react": "16.6.3",
"react-native": "0.58.4",
"react-native-elements": "^1.0.0-beta7",
"react-native-fast-image": "^5.1.2",
"react-native-gesture-handler": "^1.0.12",
"react-native-keychain": "^3.0.0",
"react-native-remote-svg": "^1.4.0",
"react-native-render-html": "^4.0.0",
"react-native-scrollable-tab-view": "^0.10.0",
"react-native-snap-carousel": "^3.7.5",
"react-native-splash-screen": "^3.1.1",
"react-native-svg": "^9.0.0",
"react-native-touch-id": "^4.3.0",
"react-native-vector-icons": "^6.1.0",
"react-navigation": "^3.0.9",
"react-navigation-transitions": "^1.0.8",
"react-redux": "^6.0.0",
"redux": "^4.0.1",
"redux-form": "^8.1.0",
"redux-persist": "^5.10.0",
"reselect": "^4.0.0"
},
"devDependencies": {
"@babel/plugin-transform-react-jsx-source": "^7.2.0",
"babel-eslint": "^10.0.1",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "24.1.0",
"babel-plugin-module-resolver": "^3.1.3",
"eslint": "^5.12.0",
"eslint-plugin-react": "^7.12.3",
"eslint-plugin-react-native": "^3.6.0",
"jest": "24.1.0",
"metro-react-native-babel-preset": "0.51.1",
"react-test-renderer": "16.6.3",
"react-native-debugger": "^1.1.0",
"redux-devtools-extension": "^2.13.7"
},
Issue:
Unable to resolve module react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes from /Users/vagrant/git/node_modules/react-native-render-html/src/HTMLUtils.js: Module react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes does not exist in the Haste module map

This has been fixed in version 4.0. If you're using react-native 0.58 and above, please update.

@dmitriy-saltovskiy try to clean your packager's cache. This looks like a bundle problem. You should be fine, based on the versions you're using.

FYI the change made broke this package for anyone using React Native <58.0. Might want to consider using conditional imports for situations like this. I would love to use the changes in this package in version 4.1.0 but I can not because I am waiting for the later versions of React Native to become more stable before upgrading.

@KalebMatthews I merged this because this was blocking for too much people. I plan on restoring the backwards compatibility next week.

v4.1.1 has restored backwards compatibility.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aiavci picture aiavci  路  3Comments

jamesawer3 picture jamesawer3  路  3Comments

presencewebdesign picture presencewebdesign  路  7Comments

gabriel-tentaculo picture gabriel-tentaculo  路  7Comments

chadmorrow picture chadmorrow  路  7Comments