Skip to content

Add hook to control all state from parent #24

@nerdyman

Description

@nerdyman

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} />
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions