wisesplit/components/Person.tsx
2022-10-24 02:10:52 -05:00

14 lines
313 B
TypeScript

import { Atom, useAtom } from "jotai";
export interface IPerson {
name: string;
}
export interface Props {
personAtom: Atom<IPerson>;
}
export default function Person({ personAtom }: Props) {
const [person, _] = useAtom(personAtom);
return <span style={{ marginInline: "5px" }}>{person.name}</span>;
}