I'm trying to work with Firebase. For comfortable work I use "react-firebase-hooks".
How do I get the doc id and doc data at the same time to transfer them to props? So far I can only get the doc data.
const TodoList: FC = () => {
const [user] = useAuthState(auth)
const [todos] = useCollectionData(collection(db, `users/${user?.email}/todos`))
return (
<section className="todo-list">
{todos?.map(todo => (
<Todo isCompleted={todo.isCompleted} text={todo.text} />
))}
</section>
)
}