Slide 9
Slide 9 text
useRefͷ࣮
function mountRef(initialValue: T): {current: T} {
const hook = mountWorkInProgressHook();
const ref = {current: initialValue};
if (__DEV__) {
Object.seal(ref);
}
hook.memoizedState = ref;
return ref;
}
function updateRef(initialValue: T): {current: T} {
const hook = updateWorkInProgressHook();
return hook.memoizedState;
}
ϝϞϦ্ͷΛຖճฦ͚ͩ͢
ϝϞϦ্ͰΦϒδΣΫτΛอ࣋
currentϓϩύςΟʹΛอ࣋