mirror of
https://github.com/Steffo99/festa.git
synced 2024-12-25 08:04:22 +00:00
14 lines
354 B
TypeScript
14 lines
354 B
TypeScript
|
import { useEffect } from "react"
|
||
|
import { useDefinedContext } from "../../utils/definedContext"
|
||
|
import { PostcardContext } from "./PostcardContext"
|
||
|
|
||
|
export function usePostcardImage(image: string) {
|
||
|
const { setImage } = useDefinedContext(PostcardContext)
|
||
|
|
||
|
useEffect(
|
||
|
() => {
|
||
|
setImage(image)
|
||
|
},
|
||
|
[image]
|
||
|
)
|
||
|
}
|