We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StyleSheet.flatten return types which are incompatible with NativeComponents. I am using [email protected], which is the same as [email protected]
StyleSheet.flatten
[email protected]
Cannot create View element because inexact ____DangerouslyImpreciseStyle_Internal [1] is incompatible with exact $ReadOnly [2] in property style. App.js 21│ export default class App extends Component<Props> { 22│ render() { 23│ return ( 24│ <View style={StyleSheet.flatten(styles.container)}> 25│ <Text style={styles.welcome}>Welcome to React Native!</Text> 26│ <Text style={styles.instructions}>To get started, edit App.js</Text> 27│ <Text style={styles.instructions}>{instructions}</Text> 28│ </View> 29│ ); 30│ } 31│ } node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.js [2] 647│ $ReadOnly<$Shape<____ViewStyle_Internal>>, node_modules/react-native/Libraries/StyleSheet/flattenStyle.js [1] 19│ ): ?DangerouslyImpreciseStyle {
diff --git a/App.js b/App.js index bb48232..b9b5335 100644 --- a/App.js +++ b/App.js @@ -21,7 +21,7 @@ type Props = {}; export default class App extends Component<Props> { render() { return ( - <View style={styles.container}> + <View style={StyleSheet.flatten(styles.container)}> <Text style={styles.welcome}>Welcome to React Native!</Text> <Text style={styles.instructions}>To get started, edit App.js</Text> <Text style={styles.instructions}>{instructions}</Text>
yarn flow
Flow compilation should be successful.
https://github.com/Esemesek/RNFlowRepro
React Native Environment Info: System: OS: macOS 10.14.2 CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU @ 2.30GHz Memory: 101.36 MB / 8.00 GB Shell: 5.3 - /bin/zsh Binaries: Node: 11.6.0 - /usr/local/bin/node Yarn: 1.13.0 - /usr/local/bin/yarn npm: 6.5.0 - /usr/local/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 Android SDK: API Levels: 27, 28 Build Tools: 27.0.3, 28.0.2, 28.0.3 System Images: android-24 | Google Play Intel x86 Atom, android-27 | Google APIs Intel x86 Atom IDEs: Android Studio: 3.2 AI-181.5540.7.32.5056338 Xcode: 10.1/10B61 - /usr/bin/xcodebuild npmPackages: react: 16.6.3 => 16.6.3 react-native: 0.58.4 => 0.58.4
The text was updated successfully, but these errors were encountered:
@Esemesek could you send a pull request to fix this?
Sorry, something went wrong.
This seems to be correct behaviour. Closing.
@satya164 can you at least explain why this error is coming?
No branches or pull requests
🐛 Bug Report
StyleSheet.flatten
return types which are incompatible with NativeComponents.I am using
[email protected]
, which is the same as[email protected]
To Reproduce
[email protected]
yarn flow
Expected Behavior
Flow compilation should be successful.
Code Example
https://github.com/Esemesek/RNFlowRepro
Environment
The text was updated successfully, but these errors were encountered: