Skip to content

Instantly share code, notes, and snippets.

⚛️
⚛️

WDever

⚛️
⚛️
View GitHub Profile
View style-components-what?.tsx
// style.tsx
import styled from 'styled-components';
import { Link } from 'gatsby';
import { pxToRem } from 'utils';
interface HeaderProps {
scrolled: boolean;
visibility: boolean;
}
View createRedcerEx.ts
// action.types.ts
export enum EditorTypes {
SET_BLOCK_TEXT = 'SET_BLOCK_TEXT',
SET_BLOCK_TYPE = 'SET_BLOCK_TYPE',
SET_CURRENT_BLOCK = 'SET_CURRENT_BLOCK',
ADD_BLOCK = 'ADD_BLOCK',
DELETE_BLOCK = 'DELETE_BLOCK',
View routerfunck.tsx
<Switch>
<Route exact={true} path="/modal" render={() => <div>asdfasdf</div>} />
<Route
exact={true}
path="/modal/music"
render={() => <div>asdfasdfasdf</div>}
/>
<Redirect to="/error" />
</Switch>
View global.ts
declare global {
interface Window {
android: any;
}
}
window.android = {
logout: () => console.log('logout'),
};
View forEachWhy.tsx
MealList.forEach((item, i, org) => {
if (item.length < 5) {
const InsertArr = Array(5 - item.length).fill(
<MealItemComponent
key={i}
type="detail"
item={'급식정보가\n없습니다'}
date={''}
today={false}
day={''}
View Object Arr.tsx
const board =
draft.board[
draft.board.findIndex(board => board.pk === action.meta.board_pk)
];
Object.assign(
board.comment[
board.comment.findIndex(comment => comment.pk === action.payload.pk)
],
action.payload,
);
View useLocalVar.tsx
import * as React from 'react';
const { useRef, useCallback } = React;
export function useLocalVar<T>(defaultValues: T) {
const state = useRef<T>(defaultValues);
const setState = useCallback(async (value: T) => {
state.current = value;
}, []);
View facebook account kit.tsx
import * as React from 'react';
const { useState, useEffect } = React;
interface initialFuncProps {
appId: string;
csrf: string;
version: string;
debug?: boolean;
display?: 'popup' | 'modal';
View facebook account kit.tsx
import * as React from 'react';
const { useState, useEffect } = React;
interface initialFuncProps {
appId: string;
csrf: string;
version: string;
debug?: boolean;
display?: 'popup' | 'modal';
View exex.js
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'react-app',
'plugin:prettier/recommended',
'prettier',
'airbnb',
],
You can’t perform that action at this time.