Skip to content

Instantly share code, notes, and snippets.

View valentinmakov's full-sized avatar

Valentin Makov valentinmakov

View GitHub Profile
@valentinmakov
valentinmakov / typeExample.ts
Last active July 26, 2020 12:00
Type example
interface IObject {
id: string
}
// long and ugly typing
const receiveDifferentTypes = (argument: string | 5 | IObject | null): number | {key: string} | undefined | (() => string) => {
if (argument === null) {
return undefined
}
import React from 'react';
import {
ART,
ARTShapeProps,
ARTStatic,
StyleSheet,
Text,
View,
} from 'react-native';
import React from 'react';
import {
ART,
StyleSheet,
Text,
View,
} from 'react-native';
const {
Group,
import React from 'react';
import {
StyleSheet,
Text,
View,
} from 'react-native';
const App = (): React.ReactElement => {
return (
<View style={styles.mainContainer}>
import {AppRegistry} from 'react-native';
import App from './App';
import {name as appName} from './app.json';
AppRegistry.registerComponent(appName, () => App);
@valentinmakov
valentinmakov / tsconfig.json
Last active December 4, 2019 09:43
tsconfig.json
{
"compilerOptions": {
"allowJs": false,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true,
"jsx": "react-native",
"lib": ["es6"],
"module": "commonjs",
"moduleResolution": "node",
"noEmit": true,