View portal.js
// This example is a little bit contrived because we have more
// control over this situation, but basically I want to know if
// it's possible to render contents parent's siblings and preserve
// context of the original render site, without using any native
// code (eg: the Modal component in React Native)
import React from 'react';
import { Text, View } from 'react-native';
import { PortalHost, Portal } from 'my-imaginary-library';
View variants.re
/* Read about variants in https://reasonml.github.io/guide/language/variant */
/* Variant */
type thing = | Int(string) | Float;
type otherThing = | Int(int) | Float;
let a = Int(1);
/* Type Error: This expression has type string but an expression was expected of type int */
View reason-react-native-styles.re
open ReactNative;
/* This could live in the Style module so it works more nicely with `open Style` in `module Styles` block */
let createStyle = (sarr) => {
/* If we expose ReactNativePropRegistry.register(styleObj) then we don't need to allocate an object here */
/* -- instead, we can just return the result of that. */
let sheet = StyleSheet.create({"x": Style.style(sarr)});
sheet##x;
};
View App.js
import React, { Component } from 'react';
import { ActivityIndicator, ProgressBarAndroid, Platform, StyleSheet, Text, View } from 'react-native';
export default class App extends Component<{}> {
render() {
return (
<View style={styles.container}>
<ActivityIndicator size="small" color="green" />
<ActivityIndicator size="large" color="purple" />
<ProgressBarAndroid styleAttr="Inverse" />
View app.json
{
"expo": {
"hooks": {
"postPublish": [
{
"file": "./notify",
"config": {
"webhookUrl": "https://hooks.slack.com/put-your-stuff-here"
}
}
View example.txt
╭─ ~/coding/hello-there ag expo --ignore yarn.lock --ignore node_modules
App.js
4:export default class App extends React.Component {
app.json
2: "expo": {
package.json
7: "jest-expo": "~1.0.1",
19: "preset": "jest-expo"
View gist:a9ebaf578c140a5bd57e671220c005fd
// https://snack.expo.io/SkoufmcW-
// console.log(BarCodeScanner.Constants.BarCodeType);
iPhone Simulator: {"code39":"org.iso.Code39","code39mod43":"org.iso.Code39Mod43","code93":"com.intermec.Code93","code138":"org.iso.Code128","pdf417":"org.iso.PDF417","qr":"org.iso.QRCode","upce":"org.gs1.UPC-E","ean13":"org.gs1.EAN-13","ean8":"org.gs1.EAN-8","aztec":"org.iso.Aztec"}
Nexus 5X: {"maxicode":"maxicode","rssexpanded":"rssexpanded","codabar":"codabar","aztec":"aztec","qr":"qr","interleaved2of5":"interleaved2of5","code39":"code39","code128":"code128","ean8":"ean8","upce":"upce","upceanextension":"upceanextension","code93":"code93","pdf417":"pdf417","upca":"upca","datamatrix":"datamatrix","rss14":"rss14","ean13":"ean13"}
View app.json
{
"expo": {
"icon": "./assets/icon.png",
"sdkVersion": "17.0.0"
}
}