파이버
#19
Replies: 1 comment
-
|
기존 재조정 알고리즘
fiber
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
파이버(Fiber)란?
애플리케이션의 UI를 더 효율적으로, 특히 비동기적으로 업데이트할 수 있게 해준다.
Fiber의 특징
Fiber의 구조
type과 key
Fiber의 type은 해당 fiber가 나타내는 컴포넌트의 종류를 의미하며, key는 동일한 type을 가진 컴포넌트들 사이에서 구분하기 위해 사용된다.
child와 sibling
첫 번째 코드에서 child는 Child이고 sibling은 없다.
두 번째 코드에서 child는 Child1, Child2이고 Child1과 Child2는 sibling의 관계를 갖는다.
return fiber
현재 항목을 수행한 후 프로그램이 반환해야하는 정보를 담고 있는 fiber이다. 부모 fiber로 생각될 수도 있다.
다수의 자식 fiber를 갖고 있다면 각각의 return fiber는 그 부모이다. 위 예제에서 Child1과 Child2의 return fiber는 Parent이다.
pendingProps와 memoizedProps
pendingProps는 실행 처음에 설정되고, memoizedProps는 실행 마지막에 설정된다.
pendingProps와 memoizedProps가 같다면 이전의 결과값을 재사용하여 불필요한 업데이트를 방지할 수 있다.
pendingWorkPriority
Fiber 작업의 우선 순위를 나타낸다.
alternate
현재 Fiber와 진행 중인 작업을 나타내는 fiber(work-in-progress fiber) 사이를 전환하는 데 사용된다. 이를 통해 작업의 중단과 재개를 효율적으로 관리할 수 있다.
output
최종적으로 생성된 출력값을 나타낸다.
같이 보면 좋은 자료
Beta Was this translation helpful? Give feedback.
All reactions