Skip to content

Commit

Permalink
update exampleapp to RN 0.61.2
Browse files Browse the repository at this point in the history
  • Loading branch information
renrizzolo committed Nov 28, 2019
1 parent 05f4ef1 commit bab37ce
Show file tree
Hide file tree
Showing 8 changed files with 6,703 additions and 4,231 deletions.
3 changes: 0 additions & 3 deletions exampleapp/.babelrc

This file was deleted.

59 changes: 43 additions & 16 deletions exampleapp/.flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
; Ignore "BUCK" generated dirs
<PROJECT_ROOT>/\.buckd/

; Ignore unexpected extra "@providesModule"
.*/node_modules/.*/node_modules/fbjs/.*
; Ignore polyfills
node_modules/react-native/Libraries/polyfills/.*

; Ignore duplicate module providers
; For RN Apps installed via npm, "Libraries" folder is inside
; "node_modules/react-native" but in the source repo it is in the root
.*/Libraries/react-native/React.js
; These should not be required directly
; require from fbjs/lib instead: require('fbjs/lib/warning')
node_modules/warning/.*

; Ignore polyfills
.*/Libraries/polyfills/.*
; Flow doesn't support platforms
.*/Libraries/Utilities/LoadingView.js

[untyped]
.*/node_modules/@react-native-community/cli/.*/.*

[include]

Expand All @@ -25,24 +27,49 @@ node_modules/react-native/flow/
[options]
emoji=true

module.system=haste
esproposal.optional_chaining=enable
esproposal.nullish_coalescing=enable

module.file_ext=.js
module.file_ext=.json
module.file_ext=.ios.js

munge_underscores=true

module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> 'RelativeImageStub'
module.name_mapper='^react-native$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/react-native/react-native-implementation'
module.name_mapper='^react-native/\(.*\)$' -> '<PROJECT_ROOT>/node_modules/react-native/\1'
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\|pdf\)$' -> '<PROJECT_ROOT>/node_modules/react-native/Libraries/Image/RelativeImageStub'

suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FlowFixMeProps
suppress_type=$FlowFixMeState
suppress_type=$FixMe

suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(5[0-6]\\|[1-4][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(<VERSION>\\)? *\\(site=[a-z,_]*react_native\\(_ios\\)?_\\(oss\\|fb\\)[a-z,_]*\\)?)\\)?:? #[0-9]+
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError

unsafe.enable_getters_and_setters=true
[lints]
sketchy-null-number=warn
sketchy-null-mixed=warn
sketchy-number=warn
untyped-type-import=warn
nonstrict-import=warn
deprecated-type=warn
unsafe-getters-setters=warn
inexact-spread=warn
unnecessary-invariant=warn
signature-verification-failure=warn
deprecated-utility=error

[strict]
deprecated-type
nonstrict-import
sketchy-null
unclear-type
unsafe-getters-setters
untyped-import
untyped-type-import

[version]
^0.56.0
^0.105.0
6 changes: 6 additions & 0 deletions exampleapp/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ DerivedData
*.xcuserstate
project.xcworkspace

# Bundle artifact
*.jsbundle
# CocoaPods
/ios/Pods/

# Android/IntelliJ
#
build/
Expand All @@ -40,6 +45,7 @@ yarn-error.log
buck-out/
\.buckd/
*.keystore
!debug.keystore

# fastlane
#
Expand Down
12 changes: 5 additions & 7 deletions exampleapp/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ const Toggle = props => (
<TouchableWithoutFeedback onPress={() => props.onPress(!props.val)} disabled={props.disabled}>
<View style={styles.switch}>
<Text style={styles.label}>{props.name}</Text>
<Switch onTintColor={tintColor} onValueChange={v => props.onPress(v)} value={props.val} />
<Switch trackColor={tintColor} onValueChange={v => props.onPress(v)} value={props.val} />
</View>
</TouchableWithoutFeedback>
)
Expand All @@ -307,11 +307,8 @@ export default class App extends Component {
this.maxItems = 5
}

componentWillMount() {
// this.fetchCategories()
this.pretendToLoad()
}
componentDidMount() {
this.pretendToLoad()
// programatically opening the select
// this.SectionedMultiSelect._toggleSelector();
}
Expand Down Expand Up @@ -555,7 +552,7 @@ export default class App extends Component {
renderSelectText = () => {
const { selectedItemObjects } = this.state

return selectedItemObjects.length
const selectText = selectedItemObjects.length
? `I like ${selectedItemObjects
.map((item, i) => {
let label = `${item.title}, `
Expand All @@ -565,6 +562,7 @@ export default class App extends Component {
})
.join('')}`
: 'Select a fruit'
return <Text style={{ color: 'red', fontSize: 24 }}>{selectText}</Text>
}

SelectOrRemoveAll = () =>
Expand Down Expand Up @@ -658,7 +656,7 @@ export default class App extends Component {
loadingComponent={
<Loading hasErrored={this.state.hasErrored} fetchCategories={this.fetchCategories} />
}
iconRenderer={this.icon}
// iconRenderer={this.icon}
// cancelIconComponent={<Text style={{color:'white'}}>Cancel</Text>}
showDropDowns={this.state.showDropDowns}
expandDropDowns={this.state.expandDropDowns}
Expand Down
3 changes: 3 additions & 0 deletions exampleapp/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
};
16 changes: 16 additions & 0 deletions exampleapp/metro.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/**
* Metro configuration for React Native
* https://github.com/facebook/react-native
*
* @format
*/
module.exports = {
transformer: {
getTransformOptions: async () => ({
transform: {
experimentalImportSupport: false,
inlineRequires: false,
},
}),
},
};
Loading

0 comments on commit bab37ce

Please sign in to comment.