Skip to content

Commit

Permalink
Convert tournament from useRef to useState
Browse files Browse the repository at this point in the history
In the Tournament component, convert from a ref:

    const tournament_ref = useRef<TournamentInterface>(...);

to a state:

    const tournament = useState<TournamentInterface>(...);

This enabled the following additional changes:

- Remove `refresh()`.
- Removing redundant state, switching to `useMemo` for `sorted_players` and
  `raw_rounds` and local variables for others.
- Reset non-tournament state when `tournament_id` changes.

Depends on online-go#2575 (builds on top of it).
  • Loading branch information
dexonsmith committed Feb 11, 2024
1 parent 4fc758e commit f0a617a
Showing 1 changed file with 461 additions and 465 deletions.

0 comments on commit f0a617a

Please sign in to comment.