You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
The text was updated successfully, but these errors were encountered:
To make this component a bit more flexible and SSR friendly, I suggest adding a
defaultCurrent
prop.Currently,
state.current
initializes with0
, always. That means, the only way to influence it, is to callsetState
, andsetState
could be called just on a mounted component (in client's browser), after the initial render. And the initialrender
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?
The text was updated successfully, but these errors were encountered: