Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
import * as Native from 'react-native';
import styled from 'styled-components'
import TextInputMask from 'react-native-text-input-mask'
const Layout = {
Container: styled.View`
align-items: center;
justify-content: center;
padding: 5%;
import React, { useState } from 'react';
import { Text, TextInput, View } from 'react-native';
const Application = () => {
const [text, setText] = useState('');
function onChangeText(text) {
setText(text.replaceAll(/[0-9]/g,'X'))
}
return (
<View>
import React, { useState } from 'react';
import { Button, Text, TextInput, View } from 'react-native';
export default function Application() {
const [text, setText] = useState('');
const [enableSecure, setEnableSecure] = useState(true);
function toggleSecure() {
setEnableSecure(value => !value)
}
return (
<TextInput
keyboardType="email-address"
onChangeText={setText}
defaultValue={text}
/>
import React, { useState } from 'react';
import { Text, TextInput, View } from 'react-native';
export default function Application() {
const [text, setText] = useState('');
return (
<View>
<TextInput
onChangeText={text => setText(text)}
defaultValue={text}
const Form = [
{
slug: 'textinput1',
label: 'Simple Textual Input',
props: {
placeholder: 'Edit me!'
}
},
{
slug: 'mailaddress',
Parse.Cloud.afterLiveQueryEvent('DogObject', async (request) => {
if (request.event == "Create") {
// If I am creating a new Dog
const thisDog = request.object;
thisDog.set('name', 'Fido'); // Set its name to Fido
} else if (request.event == "update") {
// Else, if I am Updating an existing Dog
const thisDog = request.object;
thisDog.set('name', 'Rex'); // Set its name to Rex
} else {
Parse.Cloud.define("testFunction", async (request) => {
yolo
});
Parse.Cloud.beforeSave('History', req => {
// logic will only get called if req.master is false
},{
skipWithMasterKey:true
});
Parse.Cloud.beforeSave(Parse.User, () => {
// any additional beforeSave logic here
}, {
fields: {
accType: {
default: 'viewer',
constant: true
},
},
});