mirror of https://git.lenooby09.tech/LeNooby09/social-app.git
1const React = require('react')
2const $empty = Symbol.for('react.memo_cache_sentinel')
3/**
4 * DANGER: this hook is NEVER meant to be called directly!
5 *
6 * Note that this is a temporary userspace implementation of this function
7 * from React 19. It is not as efficient and may invalidate more frequently
8 * than the official API. Please upgrade to React 19 as soon as you can.
9 **/
10export function c(size) {
11 // eslint-disable-next-line react-hooks/rules-of-hooks
12 return React.useState(() => {
13 const $ = new Array(size)
14 for (let ii = 0; ii < size; ii++) {
15 $[ii] = $empty
16 }
17 // @ts-ignore
18 $[$empty] = true
19 return $
20 })[0]
21}