Skip to content

Instantly share code, notes, and snippets.

View calendee's full-sized avatar

Calendee LLC calendee

View GitHub Profile
// Be sure to import the Keyboard
import { Keyboard } from 'react-native'
// Tell the view what to do with taps
const shouldSetResponse = () => true;
const onRelease = () => (
Keyboard.dismiss()
);
// Your view
<SafeAreaView>
<ScrollView
keyboardDismissMode="on-drag"
style={ styles.view }
>
<TextInput
autoCapitalize="none"
keyboardType="email-address"
onChangeText={ this.changeEmailText }
<SafeAreaView>
<View>
<TextInput
autoCapitalize="none"
keyboardType="email-address"
onChangeText={ this.changeEmailText }
placeholder="Email Address"
style={ [styles.textInput, emailInvalid ? styles.textInputError : null] }
testID="email"
import React, { Component } from "react";
import { connect } from "react-redux";
import { Field, FieldArray, reduxForm, arrayPush } from "redux-form";
import { customInput, customSelect, discounts } from "./fields";
import capitalize from "capitalize";
import {
required,
minLength,
maxLength,
matchesPassword,
{
"discountCodes": [
"ABC200",
"XYZ500",
null
],
"firstname": "Justin"
}
<form onSubmit={handleSubmit}>
<Field
name="firstname"
component={customInput}
type="text"
label="First Name"
validate={[required]}
normalize={capitalize}
/>
import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
const App = props =>
console.log(JSON.stringify(props, null, 4)) || (
<div className="App">
<h1>Hello CodeSandbox</h1>
<h2>Start editing to see some magic happen!</h2>
const combineNames = (first, last) => console.log(first, last) || (
`${first} ${last}`
)
const combineNames = (first, last) => {
console.log(first, last);
return (
`${first} ${last}`
)
}
const combineNames = (first, last) => `${first} ${last}`;
const combineNames = (first, last) => (
`${first} ${last}`
)