-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
useListTransition 初始化key #14
Comments
Thank you. The useListTransition api hasn't been officially released, but it's apparently exists in the library, it's still in designing progress and will come with transition-hook v2, stay tuned~ |
@iamyoki I was looking for an example image slider or carousel using your lib. So far I could not manage to produce something usable. |
@Imfahrenheit Could you produce a codesandbox example of your carousel? I would complete it for you. |
@iamyoki Thanks for the prompt response! I quickly created a codesandbox for you to give me some pointers. The carousel should slide left or right based on prev or next direction. |
perfect! Thanks a lot, now I don't need to use react-transition-group for this. |
如果像这样使用
useListTransition(list, **300)
const keyRef = useRef(0); // change list to our list form with extra information. const initialList: Array<ItemWithState<Item>> = list.map((item, key) => ({ item, key: keyRef.current, stage: 'enter', }));
会导致key重复
The text was updated successfully, but these errors were encountered: