/
githubmirror
/
wp-calypso
Обзор
Документация
Войти
/
githubmirror
/
wp-calypso
Код
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/swipeable/docs/example.jsx
24 строки
566 B
Omar Alshaker
Package: DotPager, Swipeable, and EmbedContainer (#92038)
26 июн 2024, 18:32
Не верифицирован
26 июн 2024, 18:32
8e12869
Код
Авторство
О чём код?
import { useState } from 'react'; import Swipeable from '../index'; const SwipeableExample = () => { const [ currentPage, setCurrentPage ] = useState( 0 ); return ( <Swipeable onPageSelect={ ( index ) => { setCurrentPage( index ); } } currentPage={ currentPage } pageClassName="example-page-component-class" hasDynamicHeight > <div>Page 1 - Swipe Left</div> <div>Page 2 - Swipe Left or Right</div> <div>Page 3 - Swipe Right</div> </Swipeable> ); }; SwipeableExample.displayName = 'Swipeable'; export default SwipeableExample;