Credit: Some phraseology taken from MDN
Today we are going to walk through some JavaScript miscellany. Hopefully it causes some good discussion, and serves as a refresher. Please ask questions and make interesting comments!
0.1 + 0.2 === 0.3
import React, { useCallback, useEffect, useState } from 'react' | |
import { | |
StyleSheet, | |
View, | |
Text, | |
TouchableOpacity, | |
Button, | |
Image, | |
} from 'react-native' |
import { TabNavigator } from 'react-navigation' | |
import Ionicons from 'react-native-vector-icons/Ionicons' | |
import { hook } from 'cavy' | |
class Icon extends Component { | |
render() { | |
const { navigation, generateTestHook, routeName... } = this.props | |
return <Ionicons ref={generateTestHook(`Navigation.${routeName}`)} onPress={() => navigation.navigate(routeName)} .../> | |
} | |
} |
/* | |
* EXAMPLE USAGE | |
* This component is text that will bounce on mount and | |
* every time `this.props.someProperty` changes. | |
* Too bad react native doesn't support decorators yet :/ | |
*/ | |
import React, { | |
Component, | |
StyleSheet, |
Credit: Some phraseology taken from MDN
Today we are going to walk through some JavaScript miscellany. Hopefully it causes some good discussion, and serves as a refresher. Please ask questions and make interesting comments!
0.1 + 0.2 === 0.3
// @flow | |
import type { | |
StyleObj, | |
} from 'react-native/Libraries/StyleSheet/StyleSheetTypes'; | |
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
import { Text, View, StyleSheet } from 'react-native'; | |
import invariant from 'invariant'; |
import React, { Component } from 'react'; | |
import { View, StyleSheet, Text } from 'react-native'; | |
import { TabViewAnimated, TabBar } from 'react-native-tab-view'; | |
const styles = StyleSheet.create({ | |
container: { | |
flex: 1, | |
marginTop: 20, | |
}, | |
tabbar: { |
import React, { useCallback, useState } from 'react'; | |
import { | |
Pressable, | |
StyleSheet, | |
TextInput, | |
useWindowDimensions, | |
} from 'react-native'; | |
import { useReanimatedKeyboardAnimation } from 'react-native-keyboard-controller'; | |
import Animated, { | |
interpolate, |
import React, { useMemo, useRef } from 'react'; | |
import { View } from 'react-native'; | |
import { node } from 'prop-types'; | |
import { PanGestureHandler, State, PinchGestureHandler } from 'react-native-gesture-handler'; | |
import Animated from 'react-native-reanimated'; | |
import styles from './styles'; | |
/** styles.js | |
import { StyleSheet } from 'react-native'; |
// This sample is a Work in Progress for JSI , and specific functions may change. | |
#pragma once | |
#include <string> | |
#include <unordered_map> | |
#include <jsi/jsi.h> | |
// This SameplJSIObject needs to inheric from HostObject, and this is the object that will be exposed to JS. |