@ray-js/components-ty-perf-text 组件报错
Posted: 2024年 Aug 9日 11:12
- Tuya MiniApp Tools 版本信息:Node: v18.17.0 Tools: 0.7.0 Ray: 1.5.20
- App 应用版本信息: 设置-关于中进行查看~
- @ray-js/ray, @ray-js/panel-sdk的版本: "@ray-js/panel-sdk": "1.10.0","@ray-js/ray": "1.5.20",
"@ray-js/components-ty-perf-text": "0.0.6",
"@ray-js/components-ty-slider": "0.2.46", - 问题描述(复现步骤):使用组件有这个错误信息
报错说明PerfText 组件中 textStyle 属性期望接收一个对象类型的值,但实际接收到的是 null 类型的值
Code: Select all
service.js?side=service:3 [Component] property "textStyle" of "_npm/@ray-js/components-ty-perf-text/lib/perf-text/index" received type-uncompatible value: expected <Object> but got null-typed value. Used null instead.
但接口中不存在该属性,而组件存在该属性
这是接口中的属性组件中的属性Code: Select all
import React from 'react'; export interface IProps { /** * @description.en instanceId * @description.zh instanceId * @default null */ instanceId?: string; /** * @description.en event channel eventName * @description.zh event channel 事件名 * @default null */ eventName: string; /** * @description.en valueStart * @description.zh valueStart * @default 0 */ valueStart?: number; /** * @description.en valueScale * @description.zh valueScale * @default 1 */ valueScale?: number; /** * @description.en defaultValue * @description.zh 默认值 * @default '' */ defaultValue?: string | number; /** * @description.en style * @description.zh 样式 * @default null */ style?: React.CSSProperties; className?: string; } export declare const defaultProps: IProps;
Code: Select all
Component({ properties: { instanceId: String, eventName: String, className: String, valueStart: { type: Number, value: 0 }, valueScale: { type: Number, value: 1 }, defaultValue: { type: String, value: '' }, textStyle: { type: Object } } });