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

Provide defaultCurrent #20

Open
kostia1st opened this issue Dec 3, 2018 · 1 comment
Open

Provide defaultCurrent #20

kostia1st opened this issue Dec 3, 2018 · 1 comment

Comments

@kostia1st
Copy link

kostia1st commented Dec 3, 2018

To make this component a bit more flexible and SSR friendly, I suggest adding a defaultCurrent prop.

Currently, state.current initializes with 0, always. That means, the only way to influence it, is to call setState, and setState could be called just on a mounted component (in client's browser), after the initial render. And the initial render renders the very first image even if it's not the wanted behavior.

In my use case, I need to have a very specific image as the default one, not the one that comes first in the image collection.

What do you think?

@andrepolischuk
Copy link
Owner

cool, it will be added in #21

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