react-rotation icon indicating copy to clipboard operation
react-rotation copied to clipboard

Provide defaultCurrent

Open kostia1st opened this issue 7 years ago • 1 comments

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?

kostia1st avatar Dec 03 '18 12:12 kostia1st

cool, it will be added in https://github.com/andrepolischuk/react-rotation/pull/21

andrepolischuk avatar May 06 '19 15:05 andrepolischuk