-
Notifications
You must be signed in to change notification settings - Fork 734
migrate ActionBar to TS #987
New issue
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
Conversation
const cameraSelected = require('../../assets/icons/cameraSelected.png'); | ||
const video = require('../../assets/icons/video.png'); | ||
const tags = require('../../assets/icons/tags.png'); | ||
const collections = require('../../assets/icons/collections.png'); | ||
const richText = require('../../assets/icons/richText.png'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you change imports to require?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw we usually use require for assets..
Is import is better for this kind of usage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
require
is an es5 syntax
import
is an es6 syntax
The advantage of require
is that you can call it anywhere (anytime).
This is how we do "lazy loading" when requiring something at a specific point.
While imports always happen and are not lazy loaded
In this case when requiring at the top of the file it's equivalent to import
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got you..
Changing to import :)
src/components/actionBar/index.tsx
Outdated
/** | ||
* action bar height | ||
*/ | ||
height: PropTypes.number, | ||
height?: number, | ||
/** | ||
* action bar background color | ||
*/ | ||
backgroundColor: PropTypes.string, | ||
backgroundColor?: string, | ||
/** | ||
* actions for the action bar | ||
*/ | ||
actions: PropTypes.arrayOf(PropTypes.shape(Button.propTypes)), | ||
actions: ButtonPropTypes[], | ||
/** | ||
* should action be equally centered | ||
*/ | ||
centered: PropTypes.bool, | ||
centered?: boolean, | ||
/** | ||
* use safe area, in case action bar attached to the bottom (default: true) | ||
*/ | ||
useSafeArea: PropTypes.bool, | ||
useSafeArea?: boolean, | ||
/** | ||
* keep the action bar position relative instead of it absolute position | ||
*/ | ||
keepRelative: PropTypes.bool, | ||
keepRelative?: boolean, | ||
/** | ||
* style the action bar | ||
*/ | ||
style: PropTypes.oneOfType([PropTypes.object, PropTypes.number, PropTypes.array]) | ||
style?: ViewStyle ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
each type should end with semicolon
* master: Fix missed issue with migrating Picker API - PickerItem needs to retrieve the correct value format Add Slider testID (#999) Remove declaration of ref type on TouchableOpacity convert three digit hex to six (#976) Fix/text field right icon alignment (#997) migrate Switch to TS (#991) Move from KeyboardAwareListView to KeyboardAwareFlatList (#960) Update constants typings migrate ActionBar to TS (#987) Do not notify the user onPageChange for the fake page (fix autoscroll on Android bug) (#994) Add progress type for ProgressBarProps (#996) Fix generated JS files to include propTypes (#995) # Conflicts: # generatedTypes/components/touchableOpacity/index.d.ts
Changelog
Migration of ActionBar and ActionBarScreen to typescript.