(initialValue: T)
| 471 | } |
| 472 | |
| 473 | function useRef<T>(initialValue: T): {current: T} { |
| 474 | currentlyRenderingComponent = resolveCurrentlyRenderingComponent(); |
| 475 | workInProgressHook = createWorkInProgressHook(); |
| 476 | const previousRef = workInProgressHook.memoizedState; |
| 477 | if (previousRef === null) { |
| 478 | const ref = {current: initialValue}; |
| 479 | if (__DEV__) { |
| 480 | Object.seal(ref); |
| 481 | } |
| 482 | // $FlowFixMe[incompatible-use] found when upgrading Flow |
| 483 | workInProgressHook.memoizedState = ref; |
| 484 | return ref; |
| 485 | } else { |
| 486 | return previousRef; |
| 487 | } |
| 488 | } |
| 489 | |
| 490 | function dispatchAction<A>( |
| 491 | componentIdentity: Object, |
nothing calls this directly
no test coverage detected