Skip to content
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

Slider's first image does not seem unless you do not click the nav button while entering a page. #82

Closed
hybtli opened this issue Aug 17, 2022 · 2 comments

Comments

@hybtli
Copy link

hybtli commented Aug 17, 2022

When you are entering the first time for the page or refreshing, the first image does not seem, like the one below.

image


However, when you click the nav buttons, after arriving at the first image, it seems, like the one below.

image


Can anyone help?

const images = [{ url: file0 }, { url: file1 }, { url: file2 }];

return(
  <>
    <section className="shadow-none p-3 mb-5 rounded d-flex justify-content-center">
            <SimpleImageSlider
               width={896}
               height={504}
               images={images}
               autoPlay
               autoPlayDelay={5}
               showBullets
               showNavs
        />
      </section> 
  </>
) ;       
@hybtli hybtli closed this as completed Aug 17, 2022
@hybtli hybtli reopened this Aug 17, 2022
@marklee1972
Copy link

I encountered the same case.
Does anyone can solve this issue?

@hybtli
Copy link
Author

hybtli commented Feb 25, 2023

First of all, sorry for the late answer. While creating three variables named file0, file1, and file2, I created like that :

  const [file0, setFile0] = useState("");
  const [file1, setFile1] = useState("");
  const [file2, setFile2] = useState("");

After doing this I solved my issue:

  const [file0, setFile0] = useState<string>("");
  const [file1, setFile1] = useState<string>("");
  const [file2, setFile2] = useState<string>("");

I hope it will also solve your issue 😊

@hybtli hybtli closed this as completed Feb 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants