'use client' import ReExt from '@sencha/reext'; import { useState, useRef } from 'react'; type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse'; interface RowData { name: string; email: string; phone: string; } export default function Home() { const [row, setRow] = useState(null); const [direction, setDirection] = useState('row'); const directionRef = useRef(direction); directionRef.current = direction; return (
{ if (directionRef.current === 'row') { setDirection('column'); } else { setDirection('row'); } }} />
{ let row: RowData; if (selected[0] === undefined) { row = selected.data; } else { row = selected[0].data; } setRow(row); }} />
) }