3

I am using react-intl to change the local language and as one of the languages needs to be 'rtl', I used a solution mentioned in a question.

dir={intl.locale === 'en-US' ? 'ltr' : 'rtl'}

However, when the direction is switched to 'rtl', images do not display on swiper sliders. is there a way to fix it?

Thanks

2 Answers2

3

just add key prop to your swiper component

<Swiper key={intl.locale}></Swiper>
ImDevFps
  • 31
  • 4
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community May 23 '23 at 08:41
2

I found the answer. If you ever faced such a problem, the only thing to do is to give your swiper style={{ direction: "ltr" }}