본문 바로가기

React/React - 잡동사니

(6)
Json Control 하기 // input = json // item = data title // input[item] == data contents for (var item in input){ console.log('item: ' + input[item]); }
@material-ui/core UI를 Class로 구현하기 https://github.com/mui-org/material-ui/issues/15820 @material-ui/styles: Usage in a Class Component? · Issue #15820 · mui-org/material-ui How does one use the makeStyles API within a class component? The documentation only shows examples for function components. When I try to use this within a class component's render method, I g... github.com import { withStyles } from '@material-ui/core/styles..
Arrow Function 및 전역객체의 의미 출처 : https://blueshw.github.io/2017/07/01/arrow-function/ https://blueshw.github.io/2017/07/01/arrow-function/ blueshw.github.io 핵심 객체지향 언어에서의 일반적인 this 의 의미(현재 객체를 지칭)와는 달리 자바스크립트의 this 는 실행시의 context 를 말하죠 Example render() { return Goodbye bind without this; } 여기서 handleClick이 Arrow Function이 아니라면 Undefined 가 호출이 된다 그 이유는 - render() 에서의 this.handleClick은 WithoutBindTest의 handleClick을 말하는게 맞으나 ..
Props vs State https://yuddomack.tistory.com/entry/4React-Native-State%EC%99%80-Props-2%EB%B6%80Props 4.React Native State와 Props - 2부(Props) 이 글은 4.React Native State와 Props - 1부(State)와 이어집니다 Props props는 커스텀 컴포넌트와 관계가 깊습니다. 썩 와닿는 예는 아니지만 이번엔 사용자 별로 버튼을 각각 만든다고 가정해봅니다. 거두절.. yuddomack.tistory.com
Bind Method 자바스크립트 bind 메소드 Function 객체에서 기본적으로 가지고 있는 메소드 중 call / apply / bind를 많이 사용하는데, call, apply와 bind의 차이점을 알아보자. 우선 call, apply는 함수를 즉시 호출하고, 컨텍스트를 수정할 때 사용된다. (call과 apply에 대한 글 : http://jess2.tistory.com/117) 그러나, bind는 나중에 해당 함수를 이벤트에서 유용한 특정 컨텍스트로 호출할 때 사용된다. call과 apply는 즉시 함수를 호출하지만, bind는 나중에 실행될 때 함수를 호출하기 위한 올바른 컨텍스트를 갖게되는 함수를 반환한다. 이 방법은 비동기 콜백 및 이벤트에서 컨텍스트를 유지 관리할 수 있다. 즉, 특정 함수에 대해 원본 함..
Var, Let, Const 차이 Var는 변수 재설정, 재할당 가능 Let은 변수 재설정이 불가능하지만 재할당 가능 Const는 변수 재설정, 재할당 불가능 // var var c = 'test' var c = 'test2' //가능 c = 'test3' //가능 // let let a = 'test' let a = 'test2' // Uncaught SyntaxError: Identifier 'a' has already been declared a = 'test3' // 가능 // const const b = 'test' const b = 'test2' // Uncaught SyntaxError: Identifier 'a' has already been declared b = 'test3' // Uncaught TypeError:As..