Skip to content

Commit

Permalink
Update InnerBlockSlider.Controlled docs
Browse files Browse the repository at this point in the history
  • Loading branch information
roborourke authored Oct 30, 2023
1 parent affa1b9 commit cf89f92
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/InnerBlockSlider/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,14 @@ The above example code creates a slider using the core image block as each slide

### Managing the state externally.

If you need to sync the slider component state it with some other external functionality, you may need to manage state in your code. In order to to this, you need to import the InnerBlockSliderStateless rather than the standard container component exposed by the library.
If you need to sync the slider component state it with some other external functionality, you may need to manage state in your code. In order to to this, you need to use the `InnerBlockSlider.Controlled` component rather than the standard container component exposed by the library.

```js
import InnerBlockSliderStateless from '@humanmade/block-editor-components';
import InnerBlockSlider from '@humanmade/block-editor-components';

const [ currentItemIndex, setCurrentItemIndex ] = useState( 0 );

<InnerBlockSlider
<InnerBlockSlider.Controlled
// ... other props
parentBlockId={ clientId }
currentItemIndex={ currentItemIndex }
Expand Down

0 comments on commit cf89f92

Please sign in to comment.