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

Add hook to control all state from parent #24

Open
nerdyman opened this issue Nov 26, 2023 · 0 comments · May be fixed by #28
Open

Add hook to control all state from parent #24

nerdyman opened this issue Nov 26, 2023 · 0 comments · May be fixed by #28
Labels
enhancement New feature or request

Comments

@nerdyman
Copy link
Owner

nerdyman commented Nov 26, 2023

Add useReactImageTurntable hook to expose internal functions to the parent component. This will allow the parent component to hook into the internal logic of the component, simplifying state management.

Props should be passed to the hook instead of directly to the component.

Example usage

import { ReactImageTurntable, useReactImageTurntable } from 'react-image-turntable'; 

const Example = () => {
  const turntableProps = useReactImageTurntable({ autoRotate: { interval: 200 } });

  return <ReactImageTurntable {...turntableProps} />
}
nerdyman added a commit that referenced this issue Nov 26, 2023
…loses #24

BREAKING CHANGE: The library now requires the `useReactImageTurntable`
hook to be called and its props passed.
@nerdyman nerdyman linked a pull request Nov 26, 2023 that will close this issue
@nerdyman nerdyman added the enhancement New feature or request label May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant