From d80507a70f11d6c52ddffb1819ffc5b5ea0eab2b Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Tue, 4 Apr 2023 20:41:34 +0800 Subject: [PATCH] demo: fix compile error --- doric-demo/src/SliderInListDemo.tsx | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/doric-demo/src/SliderInListDemo.tsx b/doric-demo/src/SliderInListDemo.tsx index a338dd41..c33e82ee 100644 --- a/doric-demo/src/SliderInListDemo.tsx +++ b/doric-demo/src/SliderInListDemo.tsx @@ -9,6 +9,7 @@ import { SlideItem, Image, Color, + createRef, } from "doric"; const imageUrls = [ "http://b.hiphotos.baidu.com/image/pic/item/908fa0ec08fa513db777cf78376d55fbb3fbd9b3.jpg", @@ -33,18 +34,19 @@ export class SliderInListDemo extends Panel { parent={root} layoutConfig={layoutConfig().most()} itemCount={50} - renderItem={() => - ( + renderItem={() => { + const sliderRef = createRef(); + return ( { + sliderRef.current.slidePosition = idx; }} renderPage={(idx) => ( @@ -61,8 +63,8 @@ export class SliderInListDemo extends Panel { } /> - ) as ListItem - } + ) as ListItem; + }} />; } }