Skip to content

Instantly share code, notes, and snippets.

View CodingItWrong's full-sized avatar

Josh Justice CodingItWrong

View GitHub Profile
export default class NewMessageForm extends Component {
+ state = { inputText: '' }
+
+ handleChangeText = (text) => {
+ this.setState({ inputText: text });
+ }
+
render() {
+ const { inputText } = this.state;
return (
import React from 'react';
import { render, fireEvent } from 'react-native-testing-library';
import NewMessageForm from '../../NewMessageForm';
describe('NewMessageForm', () => {
describe('clicking send', () => {
const messageText = 'Hello world';
let getByTestId;
import React, { Component } from 'react';
import {
+ Button,
TextInput,
View,
} from 'react-native';
...
<TextInput
testID="messageText"
/>
import React, { Component } from 'react';
import {
+ TextInput,
View,
} from 'react-native';
export default class NewMessageForm extends Component {
render() {
return (
<View>
import React, { Component } from 'react';
import {
View,
} from 'react-native';
export default class NewMessageForm extends Component {
render() {
return (
<View>
</View>
import {
View,
} from 'react-native';
+import NewMessageForm from './NewMessageForm';
export default class App extends Component {
render() {
return (
<View>
+ <NewMessageForm />
const { reloadApp } = require('detox-expo-helpers');
describe('Creating a message', () => {
beforeEach(async () => {
await reloadApp();
});
it('should add the message to the list', async () => {
await element(by.id('messageText')).tap();
await element(by.id('messageText')).typeText('New message');
@CodingItWrong
CodingItWrong / App.vue
Created June 29, 2017 19:59
Vue.js One-Way Data Binding
<template>
<div id="app">
<ul>
<li v-for="string in strings">
{{string}}
</li>
</ul>
<ul>
<li v-for="(string, index) in strings">
<togglable-text-input v-bind:string="string" v-bind:index="index" v-on:updateString="handleUpdateString" />
@CodingItWrong
CodingItWrong / app.js
Last active June 28, 2017 18:39
import/export in node
import message from './mymodule';
console.log(message);

Keybase proof

I hereby claim:

  • I am codingitwrong on github.
  • I am codingitwrong (https://keybase.io/codingitwrong) on keybase.
  • I have a public key ASDg0SmMj4CQv4JcvGN4kZAJEQb7MaWhgCWdxyPmJYRaZwo

To claim this, I am signing this object: