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

这两个组件都用到了antd 中的Carousel走马灯,请教一下该如何处理这个问题?
ice.js 脚手架遇到了同样问题:

https://react-slick.neostack.com/docs/example/slick-go-to, 换 api 了。。。
https://react-slick.neostack.com/docs/api#methods
也遇到了这个问题,要怎么解决?
+1, 怎么解决
有人解决了这个问题么。。。
在Feature8下,是ant motion 的这个动作组件有问题:QueueAnim 把他去掉,用普通div包裹就行。原因后续看情况再追溯吧
在Feature8下,是动画的这个动作的动作有问题:队列动画 把他去掉,用普通的div就行。 走马灯点击跳转报错,有没有解决的办法 大佬
在Feature8下,是动画的这个动作的动作有问题:队列动画 把他去掉,用普通的div就行。 走马灯点击跳转报错,有没有解决的办法 大佬
所有的 goTo 换成 slickGoTo
@jljsj33 模块有计划修复Carousel API问题吗
@jljsj33 模块有计划修复Carousel API问题吗
没时间修复,如果你有兴趣,,可以 pr 来修复,感谢
childRefs.current[item.key] = c instanceof Element || item.key==='carousel' ? c : findDOMNode(c);
暂时胡写了个 carousel 回的是个 {}. 别的都是 <>
在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函数的组件上即可。