Skip to content

Instantly share code, notes, and snippets.

@ozcanzaferayan
Created May 19, 2020 16:01
Show Gist options
  • Save ozcanzaferayan/14a81dec387af26bee800ea2d21171b6 to your computer and use it in GitHub Desktop.
Save ozcanzaferayan/14a81dec387af26bee800ea2d21171b6 to your computer and use it in GitHub Desktop.
import React from "react";
import { useRecoilState } from "recoil";
import { todoListFilterState } from "../state/atoms";
export function TodoListFilters() {
const [filter, setFilter] = useRecoilState(todoListFilterState);
return (
<>
<select value={filter} onChange={(e) => setFilter(e.target.value)}>
<option value="all">All</option>
<option value="completed">Completed</option>
<option value="uncompleted">Uncompleted</option>
</select>
<br />
</>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment