将 @radix-ui/react-context 从 0.x 升级到 1.x
根据 TypeScript 类型自动比较 @radix-ui/react-context 0.1.1 与 1.2.2 的公开 API。签名变化表示可能存在不兼容变更,并非确定结论。
概要
| 已删除的导入路径 | 0 |
|---|---|
| 已删除的导出 | 1 |
| 已修改的签名 | 2 |
| 已删除的类或接口成员 | 0 |
| 已修改的类或接口成员 | 0 |
| 新增弃用 | 0 |
| 要求变化(engines、peer 依赖) | 2 |
| 新增导出 | 0 |
已删除的导出
| import | export | kind | 之前 |
|---|---|---|---|
@radix-ui/react-context | ScopeHook | type | (scope: Scope<any>) => { [__scopeProp: string]: Scope<any>; } |
已修改的签名
| export | 之前 | 之后 |
|---|---|---|
@radix-ui/react-context · createContext | <ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType | undefined): readonly [{ (props: ContextValueType & { children: React.ReactNode; }): JSX.Element; displayName: string; }, (consumerName: string) => ContextValueType] | <ContextValueType extends object | null>(rootComponentName: string): readonly [React.FC<ContextValueType & { children: React.ReactNode; }>, UseContext<ContextValueType>] | <ContextValueType extends object | null>(rootComponentName: string, defaultContext: ContextValueType): readonly [React.FC<ContextValueType & { children: React.ReactNode; }>, UseAssertedContext<ContextValueType>] |
@radix-ui/react-context · createContextScope | (scopeName: string, createContextScopeDeps?: CreateScope[] | undefined): readonly [<ContextValueType extends object | null>(rootComponentName: string, defaultContext?: ContextValueType | undefined) => readonly [{ (props: ContextValueType & { scope: Scope<ContextValueType>; children: React.ReactNode; }): JSX.Element; displayName: string; }, (consumerName: string, scope: Scope<ContextValueType | undefined>) => ContextValueType], CreateScope] | (scopeName: string, createContextScopeDeps?: CreateScope[] | undefined): readonly [CreateScopedContext, CreateScope] |
已删除的类或接口成员
未发现。
已修改的类或接口成员
未发现。
新增弃用
未发现。
要求变化(engines、peer 依赖)
| 之前 | 之后 | |
|---|---|---|
peerDependencies.react | ^16.8 || ^17.0 | ^16.8 || ^17.0 || ^18.0 || ^19.0 || ^19.0.0-rc |
peerDependencies.@types/react | — | * |
常见问题
将 @radix-ui/react-context 从 0 升级到 1 有哪些不兼容变更?
在 @radix-ui/react-context 0.1.1 与 1.2.2 之间,Vigia 发现 1 个已删除的导出、2 个已修改的签名,以及 0 个已删除或修改的类或接口成员。
@radix-ui/react-context 1 中弃用了哪些内容?
@radix-ui/react-context 1.2.2 中有 0 个导出或成员新被标记为弃用。
供智能体使用
GET https://vigia.coredls.cloud/v1/packages/npm/@radix-ui/react-context/upgrade?from=0.1.1&to=1.2.2