wisesplit/components/Person.tsx

15 lines
313 B
TypeScript
Raw Normal View History

2022-10-24 07:10:52 +00:00
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>;
}