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
// 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 |
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
<SafeAreaView> | |
<ScrollView | |
keyboardDismissMode="on-drag" | |
style={ styles.view } | |
> | |
<TextInput | |
autoCapitalize="none" | |
keyboardType="email-address" | |
onChangeText={ this.changeEmailText } |
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
<SafeAreaView> | |
<View> | |
<TextInput | |
autoCapitalize="none" | |
keyboardType="email-address" | |
onChangeText={ this.changeEmailText } | |
placeholder="Email Address" | |
style={ [styles.textInput, emailInvalid ? styles.textInputError : null] } | |
testID="email" |
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 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, |
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
{ | |
"discountCodes": [ | |
"ABC200", | |
"XYZ500", | |
null | |
], | |
"firstname": "Justin" | |
} |
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
<form onSubmit={handleSubmit}> | |
<Field | |
name="firstname" | |
component={customInput} | |
type="text" | |
label="First Name" | |
validate={[required]} | |
normalize={capitalize} | |
/> |
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 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> |
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 combineNames = (first, last) => console.log(first, last) || ( | |
`${first} ${last}` | |
) |
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 combineNames = (first, last) => { | |
console.log(first, last); | |
return ( | |
`${first} ${last}` | |
) | |
} |
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 combineNames = (first, last) => `${first} ${last}`; | |
const combineNames = (first, last) => ( | |
`${first} ${last}` | |
) |