ant-design-landing icon indicating copy to clipboard operation
ant-design-landing copied to clipboard

Uncaught Error: Argument appears to not be a ReactComponent.

Open debugksir opened this issue 4 years ago • 13 comments
trafficstars

在umi 3.5.17脚手架上使用landing,使用Feature6和Feature8组件就会报错 Uncaught Error: Argument appears to not be a ReactComponent. Keys: goTo,autoPlay,innerSlider,prev,next image

这两个组件都用到了antd 中的Carousel走马灯,请教一下该如何处理这个问题?

debugksir avatar Aug 14 '21 09:08 debugksir

ice.js 脚手架遇到了同样问题:

image

v10258 avatar Aug 17 '21 03:08 v10258

https://react-slick.neostack.com/docs/example/slick-go-to, 换 api 了。。。

jljsj33 avatar Aug 17 '21 07:08 jljsj33

https://react-slick.neostack.com/docs/api#methods

jljsj33 avatar Aug 17 '21 07:08 jljsj33

也遇到了这个问题,要怎么解决?

wyh888 avatar Aug 25 '21 10:08 wyh888

+1, 怎么解决

z575813129 avatar Sep 03 '21 07:09 z575813129

有人解决了这个问题么。。。

BongBongBang avatar Sep 08 '21 13:09 BongBongBang

在Feature8下,是ant motion 的这个动作组件有问题:QueueAnim 把他去掉,用普通div包裹就行。原因后续看情况再追溯吧

BongBongBang avatar Sep 08 '21 14:09 BongBongBang

在Feature8下,是动画的这个动作的动作有问题:队列动画 把他去掉,用普通的div就行。 走马灯点击跳转报错,有没有解决的办法 大佬

nn9140309 avatar Sep 09 '21 09:09 nn9140309

在Feature8下,是动画的这个动作的动作有问题:队列动画 把他去掉,用普通的div就行。 走马灯点击跳转报错,有没有解决的办法 大佬

所有的 goTo 换成 slickGoTo

jljsj33 avatar Sep 22 '21 05:09 jljsj33

@jljsj33 模块有计划修复Carousel API问题吗

cc7gs avatar Sep 26 '21 06:09 cc7gs

@jljsj33 模块有计划修复Carousel API问题吗

没时间修复,如果你有兴趣,,可以 pr 来修复,感谢

jljsj33 avatar Sep 27 '21 04:09 jljsj33

      childRefs.current[item.key] = c instanceof Element || item.key==='carousel' ? c : findDOMNode(c);

暂时胡写了个 carousel 回的是个 {}. 别的都是 <>

roroyu avatar Oct 09 '21 09:10 roroyu

在Feature8下,是动画的这个动作的动作有问题:队列动画 把他去掉,用普通的div就行。 走马灯点击跳转报错,有没有解决的办法 大佬

补充下: click报错,针对Feature8里的处理,把carouselRef换绑到原QueueAnim下的AntCarousel上, <div // 原QueueAnim key="queue" type="bottom" {...childrenProps} > {childWrapper.length > 1 && ( <div {...titleWrapperProps} key="title"> <div {...titleChild}>{titleToRender}</div> </div> )} <AntCarousel ref={this.carouselRef} key="carousel" {...carouselProps} infinite={false} beforeChange={this.onBeforeChange} > {childrenToRender} </AntCarousel> <div key="button" {...buttonWrapper}> {buttonWrapper.children.map(getChildrenToRender)} </div> </div> // 原QueueAnim 然后点击回调事件改成如下: onTitleClick = (_, i) => { console.log(this.carouselRef); // const carouselRef = this.carouselRef.current.childRefs.carousel; this.carouselRef.current.goTo(i); };

click失效是因为原来的QueueAnim组件换成div原生标签了,导致原来的ref引用逻辑乱了。所以修改click就是把ref重新绑定具体含有goTo函数的组件上即可。

BongBongBang avatar Sep 16 '22 11:09 BongBongBang