For AI agents: the complete documentation index is available at /next/zh/llms.txt, the full documentation bundle is available at /next/zh/llms-full.txt, and this page is available as Markdown at /next/zh/api/packages/react-rsbuild-plugin/interfaces/ReactCompileResultExposureV1.md.
Lynx
  • 简体中文
  • Interface: ReactCompileResultExposureV1

    通过 api.useExposed(Symbol.for('@lynx-js/react/internal:compile-result')) 获取的带版本号的 React 编译结果暴露接口。

    Properties

    version

    version: 1

    暴露 API 的协议版本。

    Methods

    getCompileResult()

    getCompileResult(stats: Stats | MultiStats): ReactCompileResult | undefined

    读取所提供 compilation 的语义运行时需求。

    Parameters

    ParameterTypeDescription
    statsStats | MultiStats原始 Stats 或 MultiStats 对象,应在关闭构建前读取。不支持序列化的 Stats JSON;调用方必须先处理 stats 缺失和构建错误。

    Returns

    ReactCompileResult | undefined

    返回已知结果;若任一 compilation 没有兼容的语义结果生成方,则返回 undefined。 显式 false 与 unknown 保持区别。

    Remarks

    只有所有子 compilation 都提供兼容结果时,MultiStats 才会以 OR 合并需求。 在混合环境构建中,传入单个环境的 Stats,即可独立读取该环境的结果。

    除非另有说明,本项目采用知识共享署名 4.0 国际许可协议进行许可,代码示例采用 Apache License 2.0 许可协议进行许可。