Created
April 22, 2024 21:01
-
-
Save PaulieScanlon/eec1675ae608262cc289825ef4f596bc to your computer and use it in GitHub Desktop.
Example of read only component
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
// src/components/primitive-read-only-component.tsx | |
'use client'; | |
import { useAtom } from 'jotai'; | |
import { countAtom } from '../state'; | |
export const ReadOnlyComponent = () => { | |
const [count] = useAtom(countAtom); | |
return <div>{count}</div>; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment