Wednesday, 16 April 2025

React Responsive Carousel auto play doesn't work in SPFx

Issue:

Recently, we were developing a carousal feature in SPFx webpart. We got react component code from UI Team which has used React Responsive Carousel with sample data, and it was working fine. We needed to make the carousal dynamic and fetch data from SharePoint list.

When we incorporated the changes, we faced a strange issue. When we provide the dynamic data, the carousal will load only last item and doesn’t rotate. But if we pass static data, it worked fine.

Analysis:

As the webpart working with static data, we were not sure it was issue from the component. It meant there was something missing from the implementation part. So we started looking in to online resources. One such link mentioned we needed to explicitly give the CSS path in the import as follow:

 import 'react-responsive-carousel/lib/styles/carousel.min.css'  

It didn’t change the output. So, we thought if dynamic loading might be causing the issue, then we can generate HTML first and directly pass it to the component. So, we changed our component code from below:

 public render(): React.ReactElement<IReactCarousalProps> {  
 const images = this.state.carousaldata;  
 return (  
 <div className='min-h-screen'>  
 <Carousel showArrows={true} showThumbs={true}>  
 {images.map((url, index) => {  
 <div key={index}>  
 <img src={url.name} />  
 </div>;  
 })}  
 </Carousel>  
 </div>  
 );  
 }  

And updated as below:

 public render(): React.ReactElement<IReactCarousalProps> {  
 var images = this.state.carousaldata;  
 var htmlBody = “”;  
 images.map((url, index) => {  
 htmlBody+=” <div key={index}><img src={url.name} /></div>”  
 })  
 return (  
 <div className='min-h-screen'>  
 <Carousel showArrows={true} showThumbs={true}>  
 {htmlBody}  
 </Carousel>  
 </div>  
 );  
 }  

But this completely hide the component and showcase nothing on the page (Though earlier code showcase at least last item😊). But this failure confirmed that fault is not within the implementation but is from component itself and after that we have gone through the repository issue and find out similar issue and found the resolution.

Resolution:

So, we found that it might be version issue. Many people have mentioned that downgrading the version to lower version (3.1.33) has resolved the issue for them.

But in one such comment we found that there is an alternative too. If the carousal is initialized with zero content, it will break. If it is initialized with proper data, it will work properly. So, the user has suggested that we need to check before binding component, it our data is not there, do not bind the component.

The sample code will look like:

 public render(): React.ReactElement<IReactCarousalProps> {  
 const images = this.state.carousaldata;  
 return (  
 <div className='min-h-screen'>  
 { images.length > 0 ? (  
 <Carousel showArrows={true} showThumbs={true}>  
 {images.map((url, index) => {  
 <div key={index}>  
 <img src={url.name} />  
 </div>;  
 })}  
 </Carousel>) : null}  
 </div>  
 );  
 }  

Though the user input was done on 2019, and the issue persist, I thought it would be helpful to someone with same issues.

References: 
  1. React Responsive Carousel Sample - https://github.com/leandrowd/react-responsive-carousel
  2. Issue resolution link - https://github.com/leandrowd/react-responsive-carousel/issues/321
  3. CSS Reference - https://stackoverflow.com/questions/66554854/react-responsive-carousel-is-not-displaying-properly

Thursday, 10 April 2025

How to back up Skype data?

As Microsoft has announced that Skype will be retiring in May 2025. This will impact free and paid skype users but not Skype for Business users.

Link - Skype is retiring in May 2025: What you need to know - Microsoft Support

So, with the end of Skype, Microsoft is asking you to use Teams for free with same credentials. You can start working with Teams with login into skype and clicking start using team:



But for future safety, we should keep our back up of files. To download all your shared files in Skype, you can visit below link:

https://go.skype.com/export

It will open new page where you have 2 options:
  1. Conversations
  2. File


You can select files or both and click submit request. Based on your data size the export will be available in .tar file.




This was quick blog about data backup. If you need any other details, you can visit below FAQ page link:

How do I export or delete my Skype data? - Microsoft Support