Skip to content

Instantly share code, notes, and snippets.

View WDever's full-sized avatar
⚛️
⚛️

Minoah WDever

⚛️
⚛️
View GitHub Profile
const solution = (s) => {
let pEa = 0;
let yEa = 0;
pEa = (s.match(/p/gi) || []).length;
yEa = (s.match(/y/gi) || []).length;
console.log(pEa, yEa);
if(pEa === yEa) {
import React, { Component } from 'react';
import Form from './components/Form';
import TimerTemplate from './components/TimerTemplate';
import Button from './components/Button';
class App extends Component {
state = {
contents: true,
hour: 0,
min: 0,
// App.js
import React, { Component } from 'react';
import Button from './Button';
import './App.css';
class App extends Component {
state = {
num: 0,
}
handleclick = () => {
/* eslint-disable no-unused-expressions */
/* eslint-disable react/forbid-prop-types */
import * as React from 'react';
import { withRouter } from 'react-router-dom';
import { bindActionCreators, Dispatch } from 'redux';
import { connect } from 'react-redux';
import SearchBar from '../components/SearchBar';
import SearchResults from '../components/SearchResults';
import SearchChanger from '../components/SearchChanger';
import * as api from '../lib/api';
class ChatBot extends React.Component<ChatBotProps, ChatBotState> {
public handleToggle = async (): Promise<void> => {
this.setState(() => ({
toggle: !this.state.toggle,
}));
this.ChatScroll = React.createRef();
await console.log(this.ChatScroll);
// await console.log(this.ChatScroll.scrollTop);
.login-wrapper {
// opacity: 0;
width: 70%;
height: 90%;
display: inline-flex;
flex-direction: column;
margin: 4rem 0 0 0;
// &:hover {
// transition: opacity 1s;
@WDever
WDever / why.tsx
Last active April 15, 2019 14:40
public handleSubmit = async (e: React.FormEvent<HTMLFormElement>) => {
const { login } = this.props;
const { id, password } = this.state;
e.preventDefault();
console.log(this.props);
await login({ id, password }); // redux-saga를 이용해 api 요청을 하는 함수. LOGIN 액션.
await this.afterLogin(); // 로그인 요청 이후 실행될 함수
import * as React from 'react';
import styled from 'styled-components';
import { RouteComponentProps } from 'react-router-dom';
import AccoutKit from 'react-facebook-account-kit';
import { transitions } from 'lib/styles';
import { useInputs } from 'lib/hooks';
import { PhoneCheckProps, PhoneCheckMethod } from 'container/auth/phoneCheck';
import { PhoneCheckResType } from 'store';
const { useState, useEffect } = React;
type GetCodeStatus = | 'none'
| 'PARTIALLY_AUTHENTICATED'
| 'NOT_AUTHENTICATED'
| 'BAD_PARAMS';
const getCodeStatus = useRef<GetCodeStatus>('none');
const setGetCodeStatus = (resStatus: GetCodeStatus) => {
getCodeStatus.current = resStatus;
};
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
'react-app',
'plugin:prettier/recommended',
'prettier',
'airbnb',
],