mirror of
https://github.com/hanzoai/vite.git
synced 2026-10-30 19:36:16 +00:00
12 lines
321 B
React
12 lines
321 B
React
import { useContext } from 'react'
|
|
import { CountContext } from './CountProvider'
|
|
|
|
export function ContextButton() {
|
|
const { count, setCount } = useContext(CountContext)
|
|
return (
|
|
<button id="context-button" onClick={() => setCount((count) => count + 1)}>
|
|
context-based count is: {count}
|
|
</button>
|
|
)
|
|
}
|