Created
May 19, 2020 14:14
-
-
Save ozcanzaferayan/fe66179a4b6af8820c41e580d4f3843e 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, atom } from "recoil"; | |
const todoListState = atom({ | |
key: "todoListState", | |
default: ["Apples", "Eggs", "Butter"], | |
}); | |
function App() { | |
const todoList = useRecoilValue(todoListState); | |
return ( | |
<> | |
{todoList.map((item) => ( | |
<li key={item}>{item}</li> | |
))} | |
</> | |
); | |
} | |
export default App; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment