-
🚫 забрать напрямую из стейта
react-navigation- 🚫 увеличивает количество связей компонента или VM, заставляет явно указывать зависимость от
react-navigation - 🚫 не позволяет передать параметры в компонент скрина кроме как через навигацию
- 🚫 увеличивает количество связей компонента или VM, заставляет явно указывать зависимость от
-
✅ использовать декоратор
@mapNavigationStateParamsToProps, который прозрачно переложит параметры из навигатора вpropsкомпонента скрина- ✅ нет лишней зависимости от
react-navigation - ✅ компонент скрина остаётся классическим
reactкомпонентом, получающим все параметры черезprops
- ✅ нет лишней зависимости от
-
✅ подталкивает к явному указанию типов параметров через интерфейс
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| "scripts": { | |
| "start": "node node_modules/react-native/local-cli/cli.js start --reset-cache", | |
| "start-no-reset": "node node_modules/react-native/local-cli/cli.js start", | |
| "packager:kill": "react-native-kill-packager", | |
| "packager:restart": "react-native-kill-packager; npm start", | |
| "lint": "eslint . --cache --ext js", | |
| "lint-fix": "eslint src/ --ext js --fix", | |
| "flow": "flow", | |
| "android": "node node_modules/react-native/local-cli/cli.js run-android", | |
| "ios": "node node_modules/react-native/local-cli/cli.js run-ios", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| set -x #echo on | |
| set -e | |
| ### vars | |
| CI_BUILD_NUMBER=${CI_BUILD_NUMBER:=0} | |
| BUILD_TARGET=${BUILD_TARGET:='staging'} | |
| CI_FABRIC_UPLOAD=${CI_FABRIC_UPLOAD:='NO'} # YES | NO | |
| WORK_DIR=${HOME}/work |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| ### This one is automatically executed by build process. See xcode Build Phases->Build Fabric | |
| ### Set BUILD_ENV in XCode project Build Settings | |
| api_key=`sed -nE 's/^FABRIC_API_KEY\=(.*)$/\1/p' ../config/${BUILD_ENV}.ios.env` | |
| build_secret=`sed -nE 's/^FABRIC_BUILD_SECRET\=(.*)$/\1/p' ../config/${BUILD_ENV}.ios.env` | |
| ./Fabric.framework/run "$api_key" "$build_secret" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import * as React from 'react'; | |
| import { StyleProp, TextStyle } from 'react-native'; | |
| import MarqueeText from 'react-native-marquee'; | |
| // Логика работы бегущей строки: | |
| // 1. При открытии экрана с бегущей строкой сразу начинается движение строки слева-направо. | |
| // 2. По достижении конца строки пауза 2 секунды | |
| // 3. После паузы в 2 секунды строка возвращается обратно в начало (съезжает справа-налево) | |
| // 4. По достижении начала строки пауза 7 секунд | |
| // 5. После паузы в 7 секунд строка двигается слева-направо |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| declare module 'react-native-webview-messaging' { | |
| import * as React from 'react'; | |
| import { WebViewProperties } from 'react-native'; | |
| export class WebView extends React.Component<WebViewProperties> { | |
| } | |
| export const Events: { READY: string }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module.exports = { | |
| plugins: [ | |
| ['transform-inline-environment-variables', { | |
| 'exclude': 'NODE_ENV' | |
| }] | |
| ] | |
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const getStyle = styleFactory((props: StyleProps) => { | |
| return EStyleSheet.create({ | |
| $mt: `$microTheme.${props.mtName}`, | |
| container: { | |
| ...StyleSheet.flatten(props.style), | |
| }, | |
| }); | |
| }); | |
| // Использование в render компонента |
OlderNewer
