- Install prettier
- Make a .prettierignore file, and add directories you'd like prettier to not format, for example:
**/node_modules
- Run
prettier --write "**/*.js"
*Don't forget the quotes. - Optional: if you want to format JSON/SCSS files too, replace js with json/scss.
import React from 'react'; | |
import { StyleSheet, Text, View } from 'react-native'; | |
import { BarCodeScanner } from 'expo'; | |
export default class App extends React.Component { | |
render() { | |
return ( | |
<BarCodeScanner | |
onBarCodeRead={(scan) => alert(scan.data)} | |
style={[StyleSheet.absoluteFill, styles.container]} |
javascript:(function(){ localStorage.clear(); sessionStorage.clear(); var c = document.cookie.split("; "); for (i in c) { document.cookie =/^[^=]+/.exec(c[i])[0]+"=;expires=Thu, 01 Jan 1970 00:00:00 GMT"; }; })(); |
/** | |
* Created by nirlevy on 02/07/2017. | |
* MIT Licence | |
*/ | |
import React, { Component } from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Animated, Easing } from 'react-native'; | |
export class RotatingView extends Component { | |
state = { |
"scripts": { | |
"start": "node node_modules/react-native/local-cli/cli.js start --reset-cache", | |
"reset": "rm -rf node_modules/ && npm cache clear && watchman watch-del-all && npm i", | |
"testflight": "fastlane beta", | |
"android-device": "adb reverse tcp:8081 tcp:8081 && react-native run-android", | |
"lint": "jslint **.js", | |
"test": "jest", | |
"generate-apk": "cd android && ./gradlew assembleRelease && open ./app/build/outputs/apk/", | |
"install-apk": "cd android && ./gradlew installRelease" | |
}, |
facebook/react-native#1908 (comment) @alinz, @brentvatne & @jaygarcia
So lets say you want to add eval method to WebView component. What you have to do is: use category feature in objective-c.
// RCTWebView+WebViewExBridge.h
#import "RCTWebView.h"
@interface RCTWebView (WebViewExBridge)
/** | |
* | |
* Before use, type: | |
* ``` | |
* npm install xmldom --save | |
* ``` | |
*/ | |
window.DOMParser = require('xmldom').DOMParser; | |
"scripts": { | |
"start": "node node_modules/react-native/local-cli/cli.js start", | |
"rc-start": "npm start -- --reset-cache", | |
"clean": "rm -rf $TMPDIR/react-* && watchman watch-del-all && npm cache clean", | |
"clean-start": "npm run clean && npm run rc-start", | |
"fresh-install": "rm -rf $TMPDIR/react-* && watchman watch-del-all && rm -rf ios/build/ModuleCache/* && rm -rf node_modules/ && npm cache clean && npm install", | |
"fresh-start" : "npm run fresh-install && npm run rc-start", | |
"tron": "node_modules/.bin/reactotron" | |
} |
I don't like IDEs. I want to code in my editor and use the command line for everything else. I like the flow better and it feels faster to me.
I also like to have one command to do several things I want to do.
I don't want to open Xcode to create an archive, then open the archive window, then upload the archive to iTunes. It's slow and breaks my flow.
Also, in react native, it's trivial to build Android releases on the command line. I want to create and upload both iOS and android from the command line.
So after hours of searching the internet I found a flow I like for creating and uploading archives for iOS all from the command line