Skip to content

Commit

Permalink
correct viewName on start-reading
Browse files Browse the repository at this point in the history
  • Loading branch information
llaenowyd committed Sep 24, 2023
1 parent cc0b77e commit fe13787
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/StartReadingButton.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import React, { useCallback } from "react";
import { useSetRecoilState } from "recoil";
import { VIEW_NAME_WORDS_RUNNER } from "../constants";
import state from "../state";
import Button from "./Button";

const StartReadingButton = () => {
const setViewName = useSetRecoilState(state.viewName);

const onClick = useCallback(() => {
setViewName("");
setViewName(VIEW_NAME_WORDS_RUNNER);
}, [setViewName]);

return <Button onClick={onClick} value="Click Here to Start Reading" />;
Expand Down

0 comments on commit fe13787

Please sign in to comment.