Skip to content

Instantly share code, notes, and snippets.

@skflowne
Last active August 14, 2020 13:48
Show Gist options
  • Save skflowne/b1c43136bb6dcd6f5a50f19b18474429 to your computer and use it in GitHub Desktop.
Save skflowne/b1c43136bb6dcd6f5a50f19b18474429 to your computer and use it in GitHub Desktop.
import React from "react"
import { useRecoilValue } from "recoil"
import { countriesQuery } from "../state/api"
const Countries = () => {
const countries = useRecoilValue(countriesQuery)
return (
<ul>
{Object.keys(countries).map((alpha2) => {
return <li key={alpha2}>{countries[alpha2].name}</li>
})}
</ul>
)
}
export default Countries
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment