Closed hytStart closed 2 years ago
Have you tested this on web? Pretty sure we did it the other way because that workaround was needed for web support. Might be fixed by now, haven't looked at RN web support for a while.
@SteffeyDev Hi, here is my opinion. I mean
// new
import { ViewPropTypes } from 'react-native'
const stylePropType =
isWeb
? PropTypes.object
: ViewPropTypes.style
not
// old
const stylePropType =
isWeb
? PropTypes.object
: require('react-native').ViewPropTypes.style
Still have the condition of isWeb
It can be seen in this picture.
Actually, I don't understand the reason for require('react-native')
, instead of using import { ViewPropTypes } from 'react-native'
Thanks for the details. Please review #86 for a discussion of why we went with the current approach. A lot of things should work in theory, but in practice things are messier.
I'm fine with this change as long as you boot up a react native web project with your change and show that your change doesn't break web (and ideally share that environment as well so that I can confirm).
I think it's better to use
import { ViewPropTypes } from 'react-native'
here.