codeguyluke / reactnativecomponentstester Goto Github PK
View Code? Open in Web Editor NEWBoilerplate of React Native project together with tests setup, perfect for basic components testing.
Boilerplate of React Native project together with tests setup, perfect for basic components testing.
If you attempt to run the flow tests on the awesome-button component, flow outputs the following errors:
$ flow
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/components/awesome-button/awesome-button.js:18:14
Cannot create TouchableHighlight element because inexact ____DangerouslyImpreciseStyle_Internal [1] is incompatible with
exact $ReadOnly [2] in property style.
src/components/awesome-button/awesome-button.js
13│
14│ export default function AwesomeButton(props: Props) {
15│ return (
16│ <TouchableHighlight
17│ onPress={props.onPress}
18│ style={StyleSheet.flatten([style.container, props.style])}
19│ >
20│ <Text style={StyleSheet.flatten([style.text, props.textStyle])}>{props.children}</Text>
21│ </TouchableHighlight>
22│ );
23│ }
24│
node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.js
[2] 235│ $ReadOnly<$Shape<____ViewStyle_Internal>>,
node_modules/react-native/Libraries/StyleSheet/flattenStyle.js
[1] 19│ ): ?DangerouslyImpreciseStyle {
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/components/awesome-button/awesome-button.js:18:51
Cannot call StyleSheet.flatten with array literal bound to style because:
• in array element:
• Either number [1] is not an object.
• Or number [1] is incompatible with boolean literal false [2].
• Or number [1] is incompatible with empty string [3].
• in array element:
• Either array type [4] is not an object.
• Or number [5] is not an object in array element.
• Or number [5] is incompatible with boolean literal false [2] in array element.
• Or number [5] is incompatible with empty string [3] in array element.
src/components/awesome-button/awesome-button.js
[1][4][5] 10│ style?: number | Object | Array<number>,
:
15│ return (
16│ <TouchableHighlight
17│ onPress={props.onPress}
18│ style={StyleSheet.flatten([style.container, props.style])}
19│ >
20│ <Text style={StyleSheet.flatten([style.text, props.textStyle])}>{props.children}</Text>
21│ </TouchableHighlight>
node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.js
[2] 227│ | false
[3] 228│ | ''
Error ┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈┈ src/components/awesome-button/awesome-button.js:20:52
Cannot call StyleSheet.flatten with array literal bound to style because:
• in array element:
• Either number [1] is not an object.
• Or number [1] is incompatible with boolean literal false [2].
• Or number [1] is incompatible with empty string [3].
• in array element:
• Either array type [4] is not an object.
• Or number [5] is not an object in array element.
• Or number [5] is incompatible with boolean literal false [2] in array element.
• Or number [5] is incompatible with empty string [3] in array element.
src/components/awesome-button/awesome-button.js
[1][4][5] 11│ textStyle?: number | Object | Array<number>,
:
17│ onPress={props.onPress}
18│ style={StyleSheet.flatten([style.container, props.style])}
19│ >
20│ <Text style={StyleSheet.flatten([style.text, props.textStyle])}>{props.children}</Text>
21│ </TouchableHighlight>
22│ );
23│ }
node_modules/react-native/Libraries/StyleSheet/StyleSheetTypes.js
[2] 227│ | false
[3] 228│ | ''
Found 5 errors
Only showing the most relevant union/intersection branches.
To see all branches, re-run Flow with --show-all-branches
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.