Comments (5)
v2.1.0-beta.3 semi相关的ts error已全部修复。
剩余两个属于上游第三方lib的问题,需要skipLibCheckt跳过一下。
node_modules/resize-observer-polyfill/src/index.d.ts:19:18 - error TS2717: Subsequent property declarations must have the same type. Property 'contentRect' must be of type 'DOMRectReadOnly', but here has type 'DOMRectReadOnly'.
19 readonly contentRect: DOMRectReadOnly;
~~~~~~~~~~~
node_modules/typescript/lib/lib.dom.d.ts:12122:14
12122 readonly contentRect: DOMRectReadOnly;
~~~~~~~~~~~
'contentRect' was also declared here.
from semi-design.
这是个已知问题,在semi个别组件和其依赖的个别第三方lib上存在该问题。近期我们会解决下这个问题
from semi-design.
新版本还会出现类型报错问题
vite: 3.1.0
react: 17.0.2
semi-ui: 2.19.0
../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40:5 - error TS2612: Property 'context' will overwrite the base property in 'PureComponent<PortalProps, PortalState, any>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
40 context: ContextValue;
~~~~~~~
../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:104:5 - error TS2416: Property 'render' in type 'Portal' is not assignable to the same property in base type 'PureComponent<PortalProps, PortalState, any>'.
Type '() => ReactPortal' is not assignable to type '() => ReactNode'.
Type 'ReactPortal' is not assignable to type 'ReactNode'.
Type 'React.ReactPortal' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactPortal'.
Types of property 'children' are incompatible.
Type 'React.ReactNode' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactNode'.
Type '{}' is not assignable to type 'ReactNode'.
104 render() {
~~~~~~
../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
29 export { TooltipTransitionProps } from './TooltipStyledTransition';
~~~~~~~~~~~~~~~~~~~~~~
../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:182:5 - error TS2612: Property 'foundation' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
182 foundation: TooltipFoundation;
~~~~~~~~~~
../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:183:5 - error TS2612: Property 'context' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration.
183 context: ContextValue;
~~~~~~~
../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:608:14 - error TS2786: 'Portal' cannot be used as a JSX component.
Its instance type 'Portal' is not a valid JSX element.
The types returned by 'render()' are incompatible between these types.
Type 'ReactPortal' is not assignable to type 'ReactNode'.
608 <Portal getPopupContainer={this.props.getPopupContainer} style={{ zIndex }}>
~~~~~~
../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:738:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'.
738 export { Position };
~~~~~~~~
Found 7 errors in 2 files.
Errors Files
2 ../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40
5 ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29
error Command failed with exit code 1.
from semi-design.
新版本还会出现类型报错问题
vite: 3.1.0 react: 17.0.2 semi-ui: 2.19.0
../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40:5 - error TS2612: Property 'context' will overwrite the base property in 'PureComponent<PortalProps, PortalState, any>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration. 40 context: ContextValue; ~~~~~~~ ../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:104:5 - error TS2416: Property 'render' in type 'Portal' is not assignable to the same property in base type 'PureComponent<PortalProps, PortalState, any>'. Type '() => ReactPortal' is not assignable to type '() => ReactNode'. Type 'ReactPortal' is not assignable to type 'ReactNode'. Type 'React.ReactPortal' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactPortal'. Types of property 'children' are incompatible. Type 'React.ReactNode' is not assignable to type 'import("/Users/lizhi/Desktop/my-workspace/node_modules/@types/react/index").ReactNode'. Type '{}' is not assignable to type 'ReactNode'. 104 render() { ~~~~~~ ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'. 29 export { TooltipTransitionProps } from './TooltipStyledTransition'; ~~~~~~~~~~~~~~~~~~~~~~ ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:182:5 - error TS2612: Property 'foundation' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration. 182 foundation: TooltipFoundation; ~~~~~~~~~~ ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:183:5 - error TS2612: Property 'context' will overwrite the base property in 'BaseComponent<TooltipProps, TooltipState>'. If this is intentional, add an initializer. Otherwise, add a 'declare' modifier or remove the redundant declaration. 183 context: ContextValue; ~~~~~~~ ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:608:14 - error TS2786: 'Portal' cannot be used as a JSX component. Its instance type 'Portal' is not a valid JSX element. The types returned by 'render()' are incompatible between these types. Type 'ReactPortal' is not assignable to type 'ReactNode'. 608 <Portal getPopupContainer={this.props.getPopupContainer} style={{ zIndex }}> ~~~~~~ ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:738:10 - error TS1205: Re-exporting a type when the '--isolatedModules' flag is provided requires using 'export type'. 738 export { Position }; ~~~~~~~~ Found 7 errors in 2 files. Errors Files 2 ../../node_modules/@douyinfe/semi-ui/_portal/index.tsx:40 5 ../../node_modules/@douyinfe/semi-ui/tooltip/index.tsx:29 error Command failed with exit code 1.
这个是因为你的项目里存在多个版本的 @types/react(@types/react v18做了breaking change)
A.ReactNode !== B.ReactNode
统一一下再试试。
from semi-design.
from semi-design.
Related Issues (20)
- [BUG] Slider 组件的 onMouseUp 事件触发时机 HOT 3
- [BUG] <Table> text-align bug in RTL mode
- [Modal] footerFill的最左边按钮有间距看起来很奇怪 HOT 3
- [Tooltip] 添加边框样式 HOT 1
- [BUG] Form 在 vscode下 类型提示很慢 HOT 2
- [TreeSelect] 可搜索,异步加载数据的 TreeSelect,选择选项后,选项展开异常
- [FloatButton] 希望支持悬浮按钮
- how use tailwindcss HOT 1
- [BUG] <Table> onGroupedRow return className not be used
- [TreeSelect] 多选,checkRelation为 unRelated, 自定义 triggerRender,triggerRender 中无法拿到已选中值
- [Image] 为什么加载失败状态下不能触发onClick HOT 4
- [BUG] <Input> autoFocus cursor bug
- [BUG] ESM support for @semi/next
- [BUG] Breadcrumb组件会提示Warning: findDOMNode is deprecated in StrictMode警告 HOT 1
- [DatePicker] 交互设计优化 HOT 1
- [BUG] Slider 被整体 transform scale 后,把手定位不准 HOT 2
- [Table] 支持第三方滚动条插件 HOT 5
- [BUG] Form 组件在 strict & development 下调用 validate() 没有返回 HOT 1
- [Cascader] React18.2.0, 受控 Cascader,异步加载数据时,展开不符合预期
- [Button] 如何组合Tooltip使用 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semi-design.