Created
May 19, 2020 16:09
-
-
Save ozcanzaferayan/f420f1d195f3db18a28f7b4682633abe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { useRecoilValue, selector } from "recoil"; | |
import { filteredTodoListState } from "./state/selectors"; | |
import { TodoListFilters } from "./components/TodoListFilters"; | |
import { TodoItemCreator } from "./components/TodoItemCreator"; | |
import { TodoItem } from "./components/TodoItem"; | |
import { UserInfo } from "./components/UserInfo"; | |
function App() { | |
const filteredTodos = useRecoilValue(filteredTodoListState); | |
return ( | |
<> | |
<TodoListFilters /> | |
<TodoItemCreator /> | |
{filteredTodos.map((item, index) => ( | |
<TodoItem key={item.name} item={item} index={index} /> | |
))} | |
<React.Suspense fallback={<div>Loading...</div>}> | |
<UserInfo /> | |
</React.Suspense> | |
</> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment