목록전체 글 (374)
Silver Library (Archived)
What is this? useEffect is a hook in React that allows us to synchronise a component with an external system. This can be used to handle a variety of tasks, like: 1. setting up a subscription 2. manually changing the DOM 3. fetching data First of all, this is the typical and basic useEffect. import { useEffect } from 'react'; function MyComponent() { useEffect(() => { // your code here }, [depen..
I already used number of features those provided by react.js, but I just noticed one thing. Have I followed OOP by the way? What about design pattern? Above all, how can I apply such OOP norm to any of them? So, let me clarify. OOP approach with classes are: class MyComponent extends React.Component { constructor(props) { super(props); this.state = { message: 'Hello, World!' }; } handleClick() {..
Abstract. To utilise major feature in react.js, here is the example of composing the clock display. const root = ReactDOM.createRoot(document.getElementById('root')); class Clock extends React.Component { render() { return ( Hello, world! It is {this.props.date.toLocaleTimeString()}. ); } } function tick() { root.render(); } setInterval(tick, 1000); Source - codepen, Dan Abramov
삽입정렬 알고리즘? - Key 값을 정렬된 배열에 알맞은 위치에 삽입하여 정렬문제를 푸는 알고리즘으로 시간복잡도는 ceta(n^2). 노트. Big o notation 과 밀접한 연관이 있는 개념이 아닐까 생각 되는 부문. Insertion Sort Sorting Algorithm - Big-O Insertion Sort is a stable comparison sort algorithm with poor performance. Insertion Sort uses the insertion method and while it can perform at O(n) in the best case, it performs at O(n^2) in the average and worst case. big-o.io In..