Skip to content

Commit

Permalink
Change to ReadonlyArray
Browse files Browse the repository at this point in the history
  • Loading branch information
leung018 committed Jun 10, 2024
1 parent 2b8bb11 commit d7a3db0
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/components/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,14 @@ export class HomePageUIService {
function HomePage({
fetchQuestionSets,
}: {
fetchQuestionSets: () => readonly QuestionSet[]
fetchQuestionSets: () => ReadonlyArray<QuestionSet>
}) {
const router = useRouter()
const [isLoading, setLoading] = useState(true)

const [questionSets, setQuestionSets] = useState<readonly QuestionSet[]>([])
const [questionSets, setQuestionSets] = useState<ReadonlyArray<QuestionSet>>(
[],
)
useEffect(() => {
setQuestionSets(fetchQuestionSets())
setLoading(false)
Expand Down

0 comments on commit d7a3db0

Please sign in to comment.