Skip to content

Commit

Permalink
docs: improve types for FarmhandContext
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Apr 19, 2024
1 parent 523955e commit 418ab5c
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/components/Farmhand/Farmhand.context.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
/**
* @typedef {import('./Farmhand').farmhand.state} farmhand.state
*/
import { createContext } from 'react'

const FarmhandContext = createContext()
/**
* @type {import('react').Context<{
* gameState: farmhand.state
* handlers: {}
* }>}
*/
// @ts-expect-error
const FarmhandContext = createContext({
gameState: {},
handlers: {},
})

export default FarmhandContext

0 comments on commit 418ab5c

Please sign in to comment.