File tree Expand file tree Collapse file tree 4 files changed +161
-102
lines changed Expand file tree Collapse file tree 4 files changed +161
-102
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ export const NfaToDfa = () => {
3333 isModifiedTransitionTableComplete ,
3434 setIsModifiedTransitionTableComplete ,
3535 ] = useState ( false ) ;
36- const [ modifiedRows , setModifiedRows ] = useState < RowModel [ ] > ( [ ] ) ;
3736
3837 const [ isResultantDfaComplete , setIsResultantDfaComplete ] = useState ( false ) ;
3938
@@ -109,12 +108,11 @@ export const NfaToDfa = () => {
109108 ) ,
110109 } ;
111110 } ) ,
112- setRows : setModifiedRows ,
113111 setIsModifiedTransitionTableComplete : setIsModifiedTransitionTableComplete ,
114112 } ;
115113
116114 let resultantDfaProps : ResultantDfaProps = {
117- rows : modifiedRows . map ( ( row ) => {
115+ rows : dataContext . modifiedTableRows . map ( ( row ) => {
118116 return {
119117 ...row ,
120118 ...Object . fromEntries (
@@ -132,7 +130,6 @@ export const NfaToDfa = () => {
132130 ) ,
133131 } ;
134132 } ) ,
135- modifiedTableRows : modifiedRows ,
136133 setIsResultantDfaComplete : setIsResultantDfaComplete ,
137134 playgroundSize : dataContext . playgroundSize ,
138135 stateSize : dataContext . stateSize ,
Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ export const ModifiedTable = (props: ModifiedTableProps) => {
4242
4343 const dataContext = useContext ( DataContext ) ;
4444
45- const [ duration , setDuration ] = useState ( AnimationDurationOptions [ 3 ] ) ;
45+ const [ duration , setDuration ] = useState ( AnimationDurationOptions [ 0 ] ) ;
4646 const [ isPlaying , setIsPlaying ] = useState ( false ) ;
4747
4848 const [ isComplete , setIsComplete ] = useState ( false ) ; // set to true when data is completely displayed
@@ -265,8 +265,8 @@ export const ModifiedTable = (props: ModifiedTableProps) => {
265265 const rowIndex = Math . floor ( index / numberOfColumns ) ;
266266 if ( isComplete ) {
267267 setIsReady ( true ) ;
268- props . setRows ( modifiedTableRows ) ;
269268 props . setIsModifiedTransitionTableComplete ( true ) ;
269+ dataContext . setModifiedTableRows ( modifiedTableRows ) ;
270270 }
271271
272272 handleUpdateData ( rowIndex , props . rows . slice ( 0 , rowIndex ) ) ;
You can’t perform that action at this time.
0 commit comments