This file contains 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, { useState } from 'react' | |
import { TextField, IconButton } from '@material-ui/core' | |
import AddIcon from '@material-ui/icons/Add' | |
import DeleteIcon from '@material-ui/icons/Delete' | |
interface TodoItem { | |
id: number | |
value: string | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
using System; | |
using System.Collections.Generic; | |
using System.Linq.Expressions; | |
using System.Reflection; | |
namespace ADD_YOUR_NAME_SPACE_HERE | |
{ | |
public static class CustomAttributeHelper | |
{ | |
public static MemberInfo GetExpressionMember<T>(Expression<Func<T>> accessor) |
This file contains 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, { useEffect, useState } from 'react' | |
import PropTypes from 'prop-types' | |
import { Animated, Easing } from 'react-native' | |
const RotateView = ({ rotate, degree, initialDegree, duration, children, ...otherProps }) => { | |
const [rotateValue] = useState(new Animated.Value(0)) | |
useEffect(() => { | |
const toValue = rotate ? 1 : 0 |
This file contains 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
<button id="open">open</button> | |
<div class="box scale"> | |
<h1> | |
hey | |
</h1> | |
</div> |
This file contains 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 { useState } from 'react' | |
export default function useToggle(defaultValue){ | |
const [state, setState] = useState(defaultValue) | |
const toggle = (value = null) => { | |
if(value == null) | |
setState(!state) | |
else | |
setState(!!value) |
This file contains 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 { useState, useEffect } from 'react' | |
import AsyncStorage from '@react-native-community/async-storage' | |
const useAsyncStorage = (key, initialValue) => { | |
const [hasLoad, setHasLoad] = useState(false) | |
const [data, setData] = useState(initialValue) | |
const set = async newData => { | |
setData(newData) | |
return newData === null ? |
This file contains 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 { useState, useEffect } from 'react' | |
import Realm from '../database/migrations' | |
function reducer(action, { realm, name, queryObjects }) { | |
switch (action.type) { | |
case 'create': | |
return new Promise((resolve, reject) => { | |
try { | |
realm.write(() => { | |
resolve(realm.create(name, action.data)) |
NewerOlder