跳到主要内容

react 服务器(试验性-开发版)

一、主导出

ReactServer.experimental 多了个 ReactOwnerStack#captureOwnerStack

export {
Children,
REACT_ACTIVITY_TYPE as Activity,
REACT_FRAGMENT_TYPE as Fragment,
REACT_PROFILER_TYPE as Profiler,
REACT_STRICT_MODE_TYPE as StrictMode,
REACT_SUSPENSE_TYPE as Suspense,
REACT_VIEW_TRANSITION_TYPE as ViewTransition,
cloneElement,
createElement,
createRef,
use,
forwardRef,
isValidElement,
lazy,
memo,
cache,
cacheSignal,
startTransition,
getCacheForType as unstable_getCacheForType,
useId,
useCallback,
useDebugValue,
useMemo,
version,
// Experimental
// 实验性
REACT_SUSPENSE_LIST_TYPE as unstable_SuspenseList,
// enableOptimisticKey
// 启用乐观键
REACT_OPTIMISTIC_KEY as optimisticKey,
captureOwnerStack, // DEV-only
};

二、常量

以下方法由 './ReactChildren' 文件提供

const Children = {
map,
forEach,
count,
toArray,
only,
};

三、转导

嗯。。。

// These are server-only
// 这些仅限服务器使用
export {
taintUniqueValue as experimental_taintUniqueValue,
taintObjectReference as experimental_taintObjectReference,
} from './ReactTaint';