Skip to content

🐛 [Bug]: Failed prop type: Right-hand side of 'instanceof' is not an object at CSSTransition (...) when using actionsheet #986

@justin-ren

Description

@justin-ren

问题出在哪个包

@taroify/core

正在使用的 Taroify 版本是多少

0.9.0

问题出在哪个平台/设备/浏览器

weapp

重现链接

https://github.com/justin-ren/bug-taro-project

环境信息

  • 框架: Taro 4.1.5
  • UI库: @taroify/core 0.9.0
  • 开发语言: TypeScript
  • 状态管理: React Hooks
  • 样式: SCSS
  • 构建工具: Webpack 5

重现步骤

创建ActionSheet,在弹出时,微信开发者工具报错:
vendors-node_modules_taro_weapp_prebundle_chunk-6TBQVUF2_js.js?t=wechat&s=1757462143780&v=90bbcc45551b4f4ff442c7a2ecebfab9:147 Warning: Failed prop type: Right-hand side of 'instanceof' is not an object at CSSTransition (http://127.0.0.1:15378/appservice/pages/profile/index.js?t=wechat&s=1757462143780&v=fdeb10ccc28a4bf599100c499ebd650d:5483:35)(env: Windows,mp,1.06.2504010; lib: 3.9.3)

你知道如何解决这个问题吗

No

您是否愿意参与修复这个问题,并创建一个 PR

No

修复这个问题的解决方案

问题详情

  1. 错误信息

Warning: Failed prop type: Right-hand side of 'instanceof' is not an object
at CSSTransition (...)

  1. 根本原因
  • @taroify/core 0.9.0 依赖 react-transition-group 4.4.5
  • react-transition-group 的 CSSTransition 组件使用 instanceof 操作符进行 prop type 检查
  • 微信小程序环境的 JavaScript 运行时与浏览器环境不同,instanceof 操作符无法正常工作
  1. 技术细节
  • 发生位置: CSSTransition 组件的 prop type 验证
  • 触发条件: 每次 ActionSheet 打开时
  • 影响范围: 所有使用 react-transition-group 的 Taroify 组件
  1. 影响程度
  • 功能影响: ActionSheet 仍然可以正常显示和使用
  • 用户体验: 有控制台警告,但不影响主要功能
  • 性能影响: 轻微的 prop type 检查开销
  • 开发体验: 控制台警告影响调试

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions